OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 #ifndef _PK11PUB_H_ | 4 #ifndef _PK11PUB_H_ |
5 #define _PK11PUB_H_ | 5 #define _PK11PUB_H_ |
6 #include "plarena.h" | 6 #include "plarena.h" |
7 #include "seccomon.h" | 7 #include "seccomon.h" |
8 #include "secoidt.h" | 8 #include "secoidt.h" |
9 #include "secdert.h" | 9 #include "secdert.h" |
10 #include "keyt.h" | 10 #include "keyt.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 259 |
260 /* warning: cannot work with pkcs 5 v2 | 260 /* warning: cannot work with pkcs 5 v2 |
261 * use algorithm ID s instead of pkcs #11 mechanism pointers */ | 261 * use algorithm ID s instead of pkcs #11 mechanism pointers */ |
262 CK_RV PK11_MapPBEMechanismToCryptoMechanism(CK_MECHANISM_PTR pPBEMechanism, | 262 CK_RV PK11_MapPBEMechanismToCryptoMechanism(CK_MECHANISM_PTR pPBEMechanism, |
263 CK_MECHANISM_PTR pCryptoMechanism, | 263 CK_MECHANISM_PTR pCryptoMechanism, |
264 SECItem *pbe_pwd, PRBool bad3DES); | 264 SECItem *pbe_pwd, PRBool bad3DES); |
265 CK_MECHANISM_TYPE PK11_GetPadMechanism(CK_MECHANISM_TYPE); | 265 CK_MECHANISM_TYPE PK11_GetPadMechanism(CK_MECHANISM_TYPE); |
266 CK_MECHANISM_TYPE PK11_MapSignKeyType(KeyType keyType); | 266 CK_MECHANISM_TYPE PK11_MapSignKeyType(KeyType keyType); |
267 | 267 |
268 /********************************************************************** | 268 /********************************************************************** |
269 * Symetric, Public, and Private Keys | 269 * Symmetric, Public, and Private Keys |
270 **********************************************************************/ | 270 **********************************************************************/ |
271 void PK11_FreeSymKey(PK11SymKey *key); | 271 void PK11_FreeSymKey(PK11SymKey *key); |
272 PK11SymKey *PK11_ReferenceSymKey(PK11SymKey *symKey); | 272 PK11SymKey *PK11_ReferenceSymKey(PK11SymKey *symKey); |
273 PK11SymKey *PK11_ImportSymKey(PK11SlotInfo *slot, CK_MECHANISM_TYPE type, | 273 PK11SymKey *PK11_ImportSymKey(PK11SlotInfo *slot, CK_MECHANISM_TYPE type, |
274 PK11Origin origin, CK_ATTRIBUTE_TYPE operation, SECItem *key, void *wincx); | 274 PK11Origin origin, CK_ATTRIBUTE_TYPE operation, SECItem *key, void *wincx); |
275 PK11SymKey *PK11_ImportSymKeyWithFlags(PK11SlotInfo *slot, | 275 PK11SymKey *PK11_ImportSymKeyWithFlags(PK11SlotInfo *slot, |
276 CK_MECHANISM_TYPE type, PK11Origin origin, CK_ATTRIBUTE_TYPE operation, | 276 CK_MECHANISM_TYPE type, PK11Origin origin, CK_ATTRIBUTE_TYPE operation, |
277 SECItem *key, CK_FLAGS flags, PRBool isPerm, void *wincx); | 277 SECItem *key, CK_FLAGS flags, PRBool isPerm, void *wincx); |
278 PK11SymKey *PK11_SymKeyFromHandle(PK11SlotInfo *slot, PK11SymKey *parent, | 278 PK11SymKey *PK11_SymKeyFromHandle(PK11SlotInfo *slot, PK11SymKey *parent, |
279 PK11Origin origin, CK_MECHANISM_TYPE type, CK_OBJECT_HANDLE keyID, | 279 PK11Origin origin, CK_MECHANISM_TYPE type, CK_OBJECT_HANDLE keyID, |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 SECKEYPrivateKey *PK11_GenerateKeyPair(PK11SlotInfo *slot, | 501 SECKEYPrivateKey *PK11_GenerateKeyPair(PK11SlotInfo *slot, |
502 CK_MECHANISM_TYPE type, void *param, SECKEYPublicKey **pubk, | 502 CK_MECHANISM_TYPE type, void *param, SECKEYPublicKey **pubk, |
503 PRBool isPerm, PRBool isSensitive, void *wincx); | 503 PRBool isPerm, PRBool isSensitive, void *wincx); |
504 SECKEYPrivateKey * PK11_FindPrivateKeyFromCert(PK11SlotInfo *slot, | 504 SECKEYPrivateKey * PK11_FindPrivateKeyFromCert(PK11SlotInfo *slot, |
505 CERTCertificate *cert, void *wincx); | 505 CERTCertificate *cert, void *wincx); |
506 SECKEYPrivateKey * PK11_FindKeyByAnyCert(CERTCertificate *cert, void *wincx); | 506 SECKEYPrivateKey * PK11_FindKeyByAnyCert(CERTCertificate *cert, void *wincx); |
507 SECKEYPrivateKey * PK11_FindKeyByKeyID(PK11SlotInfo *slot, SECItem *keyID, | 507 SECKEYPrivateKey * PK11_FindKeyByKeyID(PK11SlotInfo *slot, SECItem *keyID, |
508 void *wincx); | 508 void *wincx); |
509 int PK11_GetPrivateModulusLen(SECKEYPrivateKey *key); | 509 int PK11_GetPrivateModulusLen(SECKEYPrivateKey *key); |
510 | 510 |
511 SECStatus PK11_EncryptWithSymKey(PK11SymKey *symKey, | 511 SECStatus PK11_Decrypt(PK11SymKey *symkey, |
512 » » » CK_MECHANISM_TYPE mechanism, SECItem *param, | 512 » » CK_MECHANISM_TYPE mechanism, SECItem *param, |
513 » » » unsigned char *out, unsigned int *outLen, | 513 » » unsigned char *out, unsigned int *outLen, |
514 » » » unsigned int maxLen, | 514 » » unsigned int maxLen, |
515 » » » const unsigned char *data, unsigned dataLen); | 515 » » const unsigned char *enc, unsigned int encLen); |
516 SECStatus PK11_DecryptWithSymKey(PK11SymKey *symkey, | 516 SECStatus PK11_Encrypt(PK11SymKey *symKey, |
517 » » » CK_MECHANISM_TYPE mechanism, SECItem *param, | 517 » » CK_MECHANISM_TYPE mechanism, SECItem *param, |
518 » » » unsigned char *out, unsigned int *outLen, | 518 » » unsigned char *out, unsigned int *outLen, |
519 » » » unsigned int maxLen, | 519 » » unsigned int maxLen, |
520 » » » const unsigned char *enc, unsigned encLen); | 520 » » const unsigned char *data, unsigned int dataLen); |
521 | 521 |
522 /* note: despite the name, this function takes a private key. */ | 522 /* note: despite the name, this function takes a private key. */ |
523 SECStatus PK11_PubDecryptRaw(SECKEYPrivateKey *key, unsigned char *data, | 523 SECStatus PK11_PubDecryptRaw(SECKEYPrivateKey *key, unsigned char *data, |
524 unsigned *outLen, unsigned int maxLen, unsigned char *enc, unsigned encLen); | 524 unsigned *outLen, unsigned int maxLen, unsigned char *enc, unsigned encLen); |
525 #define PK11_PrivDecryptRaw PK11_PubDecryptRaw | 525 #define PK11_PrivDecryptRaw PK11_PubDecryptRaw |
526 /* The encrypt function that complements the above decrypt function. */ | 526 /* The encrypt function that complements the above decrypt function. */ |
527 SECStatus PK11_PubEncryptRaw(SECKEYPublicKey *key, unsigned char *enc, | 527 SECStatus PK11_PubEncryptRaw(SECKEYPublicKey *key, unsigned char *enc, |
528 unsigned char *data, unsigned dataLen, void *wincx); | 528 unsigned char *data, unsigned dataLen, void *wincx); |
529 | 529 |
530 SECStatus PK11_PrivDecryptPKCS1(SECKEYPrivateKey *key, unsigned char *data, | 530 SECStatus PK11_PrivDecryptPKCS1(SECKEYPrivateKey *key, unsigned char *data, |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 PK11_GetLowLevelKeyIDForCert(PK11SlotInfo *slot, | 832 PK11_GetLowLevelKeyIDForCert(PK11SlotInfo *slot, |
833 CERTCertificate *cert, void *pwarg); | 833 CERTCertificate *cert, void *pwarg); |
834 SECItem * | 834 SECItem * |
835 PK11_GetLowLevelKeyIDForPrivateKey(SECKEYPrivateKey *key); | 835 PK11_GetLowLevelKeyIDForPrivateKey(SECKEYPrivateKey *key); |
836 | 836 |
837 PRBool SECMOD_HasRootCerts(void); | 837 PRBool SECMOD_HasRootCerts(void); |
838 | 838 |
839 SEC_END_PROTOS | 839 SEC_END_PROTOS |
840 | 840 |
841 #endif | 841 #endif |
OLD | NEW |