security/nss/lib/pk11wrap/secpkcs5.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     4 #ifndef _SECPKCS5_H_
     5 #define _SECPKCS5_H_
     6 #include "seccomon.h"
     7 #include "secmodt.h"
     9 /* used for V2 PKCS 12 Draft Spec */
    10 typedef enum {
    11     pbeBitGenIDNull = 0,
    12     pbeBitGenCipherKey = 0x01,
    13     pbeBitGenCipherIV = 0x02,
    14     pbeBitGenIntegrityKey = 0x03
    15 } PBEBitGenID;
    17 typedef struct PBEBitGenContextStr PBEBitGenContext;
    19 SEC_BEGIN_PROTOS
    21 /* private */
    22 SECAlgorithmID *
    23 sec_pkcs5CreateAlgorithmID(SECOidTag algorithm, SECOidTag cipherAlgorithm,
    24 			SECOidTag prfAlg, SECOidTag *pPbeAlgorithm,
    25 			int keyLengh, SECItem *salt, int iteration);
    27 /* Get the initialization vector.  The password is passed in, hashing
    28  * is performed, and the initialization vector is returned.
    29  *  algid is a pointer to a PBE algorithm ID
    30  *  pwitem is the password
    31  * If an error occurs or the algorithm id is not a PBE algrithm,
    32  * NULL is returned.  Otherwise, the iv is returned in a secitem.
    33  */
    34 SECItem *
    35 SEC_PKCS5GetIV(SECAlgorithmID *algid, SECItem *pwitem, PRBool faulty3DES);
    37 SECOidTag SEC_PKCS5GetCryptoAlgorithm(SECAlgorithmID *algid);
    38 PRBool SEC_PKCS5IsAlgorithmPBEAlg(SECAlgorithmID *algid);
    39 PRBool SEC_PKCS5IsAlgorithmPBEAlgTag(SECOidTag algTag);
    40 SECOidTag SEC_PKCS5GetPBEAlgorithm(SECOidTag algTag, int keyLen);
    41 int SEC_PKCS5GetKeyLength(SECAlgorithmID *algid);
    43 /**********************************************************************
    44  * Deprecated PBE functions.  Use the PBE functions in pk11func.h
    45  * instead.
    46  **********************************************************************/
    48 PBEBitGenContext *
    49 PBE_CreateContext(SECOidTag hashAlgorithm, PBEBitGenID bitGenPurpose,
    50         SECItem *pwitem, SECItem *salt, unsigned int bitsNeeded,
    51         unsigned int iterations);
    53 void
    54 PBE_DestroyContext(PBEBitGenContext *context);
    57 SECItem *
    58 PBE_GenerateBits(PBEBitGenContext *context);
    60 SEC_END_PROTOS
    62 #endif /* _SECPKS5_H_ */

mercurial