pam_pkcs11  0.6.9
secutil.h
Go to the documentation of this file.
1 /* ***** BEGIN LICENSE BLOCK *****
2  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3  *
4  * The contents of this file are subject to the Mozilla Public License Version
5  * 1.1 (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  * http://www.mozilla.org/MPL/
8  *
9  * Software distributed under the License is distributed on an "AS IS" basis,
10  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11  * for the specific language governing rights and limitations under the
12  * License.
13  *
14  * The Original Code is the Netscape security libraries.
15  *
16  * The Initial Developer of the Original Code is
17  * Netscape Communications Corporation.
18  * Portions created by the Initial Developer are Copyright (C) 1994-2000
19  * the Initial Developer. All Rights Reserved.
20  *
21  * Contributor(s):
22  *
23  * Alternatively, the contents of this file may be used under the terms of
24  * either the GNU General Public License Version 2 or later (the "GPL"), or
25  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26  * in which case the provisions of the GPL or the LGPL are applicable instead
27  * of those above. If you wish to allow use of your version of this file only
28  * under the terms of either the GPL or the LGPL, and not to allow others to
29  * use your version of this file under the terms of the MPL, indicate your
30  * decision by deleting the provisions above and replace them with the notice
31  * and other provisions required by the GPL or the LGPL. If you do not delete
32  * the provisions above, a recipient may use your version of this file under
33  * the terms of any one of the MPL, the GPL or the LGPL.
34  *
35  * ***** END LICENSE BLOCK ***** */
36 #ifndef _SEC_UTIL_H_
37 #define _SEC_UTIL_H_
38 
39 #include "seccomon.h"
40 #include "secitem.h"
41 #include "prerror.h"
42 #include "base64.h"
43 #include "key.h"
44 #include "secpkcs7.h"
45 #include "secasn1.h"
46 #include "secder.h"
47 #include <stdio.h>
48 
49 #define SEC_CT_PRIVATE_KEY "private-key"
50 #define SEC_CT_PUBLIC_KEY "public-key"
51 #define SEC_CT_CERTIFICATE "certificate"
52 #define SEC_CT_CERTIFICATE_REQUEST "certificate-request"
53 #define SEC_CT_PKCS7 "pkcs7"
54 #define SEC_CT_CRL "crl"
55 
56 #define NS_CERTREQ_HEADER "-----BEGIN NEW CERTIFICATE REQUEST-----"
57 #define NS_CERTREQ_TRAILER "-----END NEW CERTIFICATE REQUEST-----"
58 
59 #define NS_CERT_HEADER "-----BEGIN CERTIFICATE-----"
60 #define NS_CERT_TRAILER "-----END CERTIFICATE-----"
61 
62 #define NS_CRL_HEADER "-----BEGIN CRL-----"
63 #define NS_CRL_TRAILER "-----END CRL-----"
64 
65 /* From libsec/pcertdb.c --- it's not declared in sec.h */
66 extern SECStatus SEC_AddPermCertificate(CERTCertDBHandle *handle,
67  SECItem *derCert, char *nickname, CERTCertTrust *trust);
68 
69 
70 #ifdef SECUTIL_NEW
71 typedef int (*SECU_PPFunc)(PRFileDesc *out, SECItem *item,
72  char *msg, int level);
73 #else
74 typedef int (*SECU_PPFunc)(FILE *out, SECItem *item, char *msg, int level);
75 #endif
76 
77 typedef struct {
78  enum {
79  PW_NONE = 0,
80  PW_FROMFILE = 1,
81  PW_PLAINTEXT = 2,
82  PW_EXTERNAL = 3
83  } source;
84  char *data;
85 } secuPWData;
86 
87 /*
88 ** Change a password on a token, or initialize a token with a password
89 ** if it does not already have one.
90 ** Use passwd to send the password in plaintext, pwFile to specify a
91 ** file containing the password, or NULL for both to prompt the user.
92 */
93 SECStatus SECU_ChangePW(PK11SlotInfo *slot, char *passwd, char *pwFile);
94 
95 /* These were stolen from the old sec.h... */
96 /*
97 ** Check a password for legitimacy. Passwords must be at least 8
98 ** characters long and contain one non-alphabetic. Return DSTrue if the
99 ** password is ok, DSFalse otherwise.
100 */
101 extern PRBool SEC_CheckPassword(char *password);
102 
103 /*
104 ** Blind check of a password. Complement to SEC_CheckPassword which
105 ** ignores length and content type, just retuning DSTrue is the password
106 ** exists, DSFalse if NULL
107 */
108 extern PRBool SEC_BlindCheckPassword(char *password);
109 
110 /*
111 ** Get a password.
112 ** First prompt with "msg" on "out", then read the password from "in".
113 ** The password is then checked using "chkpw".
114 */
115 extern char *SEC_GetPassword(FILE *in, FILE *out, char *msg,
116  PRBool (*chkpw)(char *));
117 
118 char *SECU_FilePasswd(PK11SlotInfo *slot, PRBool retry, void *arg);
119 
120 char *SECU_GetPasswordString(void *arg, char *prompt);
121 
122 /*
123 ** Write a dongle password.
124 ** Uses MD5 to hash constant system data (hostname, etc.), and then
125 ** creates RC4 key to encrypt a password "pw" into a file "fd".
126 */
127 extern SECStatus SEC_WriteDongleFile(int fd, char *pw);
128 
129 /*
130 ** Get a dongle password.
131 ** Uses MD5 to hash constant system data (hostname, etc.), and then
132 ** creates RC4 key to decrypt and return a password from file "fd".
133 */
134 extern char *SEC_ReadDongleFile(int fd);
135 
136 
137 /* End stolen headers */
138 
139 /* Just sticks the two strings together with a / if needed */
140 char *SECU_AppendFilenameToDir(char *dir, char *filename);
141 
142 /* Returns result of getenv("SSL_DIR") or NULL */
143 extern char *SECU_DefaultSSLDir(void);
144 
145 /*
146 ** Should be called once during initialization to set the default
147 ** directory for looking for cert.db, key.db, and cert-nameidx.db files
148 ** Removes trailing '/' in 'base'
149 ** If 'base' is NULL, defaults to set to .netscape in home directory.
150 */
151 extern char *SECU_ConfigDirectory(const char* base);
152 
153 /*
154 ** Basic callback function for SSL_GetClientAuthDataHook
155 */
156 extern int
157 SECU_GetClientAuthData(void *arg, PRFileDesc *fd,
158  struct CERTDistNamesStr *caNames,
159  struct CERTCertificateStr **pRetCert,
160  struct SECKEYPrivateKeyStr **pRetKey);
161 
162 /* print out an error message */
163 extern void SECU_PrintError(char *progName, char *msg, ...);
164 
165 /* print out a system error message */
166 extern void SECU_PrintSystemError(char *progName, char *msg, ...);
167 
168 /* Return informative error string */
169 extern const char * SECU_Strerror(PRErrorCode errNum);
170 
171 /* print information about cert verification failure */
172 extern void
173 SECU_printCertProblems(FILE *outfile, CERTCertDBHandle *handle,
174  CERTCertificate *cert, PRBool checksig,
175  SECCertificateUsage certUsage, void *pinArg, PRBool verbose);
176 
177 /* Read the contents of a file into a SECItem */
178 extern SECStatus SECU_FileToItem(SECItem *dst, PRFileDesc *src);
179 extern SECStatus SECU_TextFileToItem(SECItem *dst, PRFileDesc *src);
180 
181 /* Read in a DER from a file, may be ascii */
182 extern SECStatus
183 SECU_ReadDERFromFile(SECItem *der, PRFileDesc *inFile, PRBool ascii);
184 
185 /* Indent based on "level" */
186 extern void SECU_Indent(FILE *out, int level);
187 
188 /* Print integer value and hex */
189 extern void SECU_PrintInteger(FILE *out, SECItem *i, char *m, int level);
190 
191 /* Print ObjectIdentifier symbolically */
192 extern SECOidTag SECU_PrintObjectID(FILE *out, SECItem *oid, char *m, int level);
193 
194 /* Print AlgorithmIdentifier symbolically */
195 extern void SECU_PrintAlgorithmID(FILE *out, SECAlgorithmID *a, char *m,
196  int level);
197 
198 /* Print SECItem as hex */
199 extern void SECU_PrintAsHex(FILE *out, SECItem *i, const char *m, int level);
200 
201 /* dump a buffer in hex and ASCII */
202 extern void SECU_PrintBuf(FILE *out, const char *msg, const void *vp, int len);
203 
204 /*
205  * Format and print the UTC Time "t". If the tag message "m" is not NULL,
206  * do indent formatting based on "level" and add a newline afterward;
207  * otherwise just print the formatted time string only.
208  */
209 extern void SECU_PrintUTCTime(FILE *out, SECItem *t, char *m, int level);
210 
211 /*
212  * Format and print the Generalized Time "t". If the tag message "m"
213  * is not NULL, * do indent formatting based on "level" and add a newline
214  * afterward; otherwise just print the formatted time string only.
215  */
216 extern void SECU_PrintGeneralizedTime(FILE *out, SECItem *t, char *m,
217  int level);
218 
219 /*
220  * Format and print the UTC or Generalized Time "t". If the tag message
221  * "m" is not NULL, do indent formatting based on "level" and add a newline
222  * afterward; otherwise just print the formatted time string only.
223  */
224 extern void SECU_PrintTimeChoice(FILE *out, SECItem *t, char *m, int level);
225 
226 /* callback for listing certs through pkcs11 */
227 extern SECStatus SECU_PrintCertNickname(CERTCertListNode* cert, void *data);
228 
229 /* Dump all certificate nicknames in a database */
230 extern SECStatus
231 SECU_PrintCertificateNames(CERTCertDBHandle *handle, PRFileDesc* out,
232  PRBool sortByName, PRBool sortByTrust);
233 
234 /* See if nickname already in database. Return 1 true, 0 false, -1 error */
235 int SECU_CheckCertNameExists(CERTCertDBHandle *handle, char *nickname);
236 
237 /* Dump contents of cert req */
238 extern int SECU_PrintCertificateRequest(FILE *out, SECItem *der, char *m,
239  int level);
240 
241 /* Dump contents of certificate */
242 extern int SECU_PrintCertificate(FILE *out, SECItem *der, char *m, int level);
243 
244 /* print trust flags on a cert */
245 extern void SECU_PrintTrustFlags(FILE *out, CERTCertTrust *trust, char *m, int level);
246 
247 /* Dump contents of public key */
248 extern int SECU_PrintPublicKey(FILE *out, SECItem *der, char *m, int level);
249 
250 #ifdef HAVE_EPV_TEMPLATE
251 /* Dump contents of private key */
252 extern int SECU_PrintPrivateKey(FILE *out, SECItem *der, char *m, int level);
253 #endif
254 
255 /* Print the MD5 and SHA1 fingerprints of a cert */
256 extern int SECU_PrintFingerprints(FILE *out, SECItem *derCert, char *m,
257  int level);
258 
259 /* Pretty-print any PKCS7 thing */
260 extern int SECU_PrintPKCS7ContentInfo(FILE *out, SECItem *der, char *m,
261  int level);
262 
263 /* Init PKCS11 stuff */
264 extern SECStatus SECU_PKCS11Init(PRBool readOnly);
265 
266 /* Dump contents of signed data */
267 extern int SECU_PrintSignedData(FILE *out, SECItem *der, char *m, int level,
268  SECU_PPFunc inner);
269 
270 extern int SECU_PrintCrl(FILE *out, SECItem *der, char *m, int level);
271 
272 extern void
273 SECU_PrintCRLInfo(FILE *out, CERTCrl *crl, char *m, int level);
274 
275 extern void SECU_PrintString(FILE *out, SECItem *si, char *m, int level);
276 extern void SECU_PrintAny(FILE *out, SECItem *i, char *m, int level);
277 
278 extern void SECU_PrintPolicy(FILE *out, SECItem *value, char *msg, int level);
279 extern void SECU_PrintPrivKeyUsagePeriodExtension(FILE *out, SECItem *value,
280  char *msg, int level);
281 
282 extern void SECU_PrintExtensions(FILE *out, CERTCertExtension **extensions,
283  char *msg, int level);
284 
285 extern void SECU_PrintName(FILE *out, CERTName *name, char *msg, int level);
286 
287 #ifdef SECU_GetPassword
288 /* Convert a High public Key to a Low public Key */
289 extern SECKEYLowPublicKey *SECU_ConvHighToLow(SECKEYPublicKey *pubHighKey);
290 #endif
291 
292 extern SECItem *SECU_GetPBEPassword(void *arg);
293 
294 extern char *SECU_GetModulePassword(PK11SlotInfo *slot, PRBool retry, void *arg);
295 
296 extern SECStatus DER_PrettyPrint(FILE *out, SECItem *it, PRBool raw);
297 extern void SEC_Init(void);
298 
299 extern char *SECU_SECModDBName(void);
300 
301 extern void SECU_PrintPRandOSError(char *progName);
302 
303 extern SECStatus SECU_RegisterDynamicOids(void);
304 
305 /* Identifies hash algorithm tag by its string representation. */
306 extern SECOidTag SECU_StringToSignatureAlgTag(const char *alg);
307 
308 /* Store CRL in output file or pk11 db. Also
309  * encodes with base64 and exports to file if ascii flag is set
310  * and file is not NULL. */
311 extern SECStatus SECU_StoreCRL(PK11SlotInfo *slot, SECItem *derCrl,
312  PRFileDesc *outFile, int ascii, char *url);
313 
314 
315 /*
316 ** DER sign a single block of data using private key encryption and the
317 ** MD5 hashing algorithm. This routine first computes a digital signature
318 ** using SEC_SignData, then wraps it with an CERTSignedData and then der
319 ** encodes the result.
320 ** "arena" is the memory arena to use to allocate data from
321 ** "sd" returned CERTSignedData
322 ** "result" the final der encoded data (memory is allocated)
323 ** "buf" the input data to sign
324 ** "len" the amount of data to sign
325 ** "pk" the private key to encrypt with
326 */
327 extern SECStatus SECU_DerSignDataCRL(PRArenaPool *arena, CERTSignedData *sd,
328  unsigned char *buf, int len,
329  SECKEYPrivateKey *pk, SECOidTag algID);
330 
331 typedef enum {
336  noMem = 5
338 
339 extern SECStatus
340 SECU_SignAndEncodeCRL(CERTCertificate *issuer, CERTSignedCrl *signCrl,
341  SECOidTag hashAlgTag, SignAndEncodeFuncExitStat *resCode);
342 
343 extern SECStatus
344 SECU_CopyCRL(PRArenaPool *destArena, CERTCrl *destCrl, CERTCrl *srcCrl);
345 
346 /*
347 ** Finds the crl Authority Key Id extension. Returns NULL if no such extension
348 ** was found.
349 */
350 CERTAuthKeyID *
351 SECU_FindCRLAuthKeyIDExten (PRArenaPool *arena, CERTSignedCrl *crl);
352 
353 /*
354  * Find the issuer of a crl. Cert usage should be checked before signing a crl.
355  */
356 CERTCertificate *
357 SECU_FindCrlIssuer(CERTCertDBHandle *dbHandle, SECItem* subject,
358  CERTAuthKeyID* id, PRTime validTime);
359 
360 
361 /* call back function used in encoding of an extension. Called from
362  * SECU_EncodeAndAddExtensionValue */
363 typedef SECStatus (* EXTEN_EXT_VALUE_ENCODER) (PRArenaPool *extHandleArena,
364  void *value, SECItem *encodedValue);
365 
366 /* Encodes and adds extensions to the CRL or CRL entries. */
367 SECStatus
368 SECU_EncodeAndAddExtensionValue(PRArenaPool *arena, void *extHandle,
369  void *value, PRBool criticality, int extenType,
370  EXTEN_EXT_VALUE_ENCODER EncodeValueFn);
371 
372 
373 /*
374  *
375  * Utilities for parsing security tools command lines
376  *
377  */
378 
379 /* A single command flag */
380 typedef struct {
381  char flag;
382  PRBool needsArg;
383  char *arg;
384  PRBool activated;
386 
387 /* A full array of command/option flags */
388 typedef struct
389 {
392 
395 } secuCommand;
396 
397 /* fill the "arg" and "activated" fields for each flag */
398 SECStatus
399 SECU_ParseCommandLine(int argc, char **argv, char *progName, secuCommand *cmd);
400 char *
401 SECU_GetOptionArg(secuCommand *cmd, int optionNum);
402 
403 /*
404  *
405  * Error messaging
406  *
407  */
408 
409 /* Return informative error string */
410 char *SECU_ErrorString(int16 err);
411 
412 /* Return informative error string. Does not call XP_GetString */
413 char *SECU_ErrorStringRaw(int16 err);
414 
415 void printflags(char *trusts, unsigned int flags);
416 
417 #ifndef XP_UNIX
418 extern int ffs(unsigned int i);
419 #endif
420 
421 #include "secerr.h"
422 #include "sslerr.h"
423 
424 #endif /* _SEC_UTIL_H_ */
const char * SECU_Strerror(PRErrorCode errNum)
int SECU_PrintPublicKey(FILE *out, SECItem *der, char *m, int level)
void SECU_PrintPolicy(FILE *out, SECItem *value, char *msg, int level)
SECStatus SEC_AddPermCertificate(CERTCertDBHandle *handle, SECItem *derCert, char *nickname, CERTCertTrust *trust)
security library failure security security library has experienced an input length error security security Improperly formatted time string Peer s certificate has an invalid signature Peer s Certificate has been revoked Peer s public key is invalid New password entered incorrectly Please try again security security Peer s certificate issuer has been marked as not trusted by the user Certificate already exists in your database Error adding certificate to database The private key for this certificate cannot be found in key database This certificate is not valid The certificate issuer s certificate has expired Check your system date and time The CRL for the certificate s issuer has an invalid signature Certificate extension value is invalid Issuer certificate is invalid Certificate usages field is invalid The key does not support the requested operation New CRL is not later than the current one Not Cannot or matching certificate and private key not found Signature verification too many signers or improper or corrupted data Cannot Fortezza card has not been properly initialized Please remove it and return it to your issuer No Fortezza card selected Personality not found Invalid Pin No KRL for this site s certificate has been found The KRL for this site s certificate has an invalid signature New KRL has an invalid format security The security card or token does not needs to be or has been removed No slot or token was selected A key with the same nickname already exists error while creating baggage object Couldn t delete the privilege Required algorithm is not allowed Error attempting to import certificates Unable to import Invalid MAC Incorrect password or corrupt file Unable to import Only password integrity and privacy modes supported Unable to import Encryption algorithm not supported Unable to import Incorrect privacy password The user pressed cancel Message not sent Certificate type not approved for application Unable to import Error attempting to import private key Unable to export Unable to locate certificate or key by nickname Unable to export Unable to write the export file Unable to export Key database corrupt or deleted Password entered is invalid Please pick a different one Certificate nickname already in use A sensitive key cannot be moved to the slot where it is needed Invalid module path filename Unable to delete module New CKL has different issuer than current CKL Delete current CKL The key revocation list for this certificate is not yet valid The requested certificate could not be found The location for the certificate status server has invalid format The OCSP server returned unexpected invalid HTTP data The OCSP server experienced an internal error The OCSP server requires a signature on this request The OCSP server returned an unrecognizable status You must enable OCSP before performing this operation The response from the OCSP server was corrupted or improperly formed The OCSP response is not yet The OCSP response contains out of date information The CMS or PKCS Could not decode ASN data Specified template was invalid You are attempting to import a cert with the same issuer serial as an existing cert
Definition: SECerrs.h:462
SECStatus SECU_SignAndEncodeCRL(CERTCertificate *issuer, CERTSignedCrl *signCrl, SECOidTag hashAlgTag, SignAndEncodeFuncExitStat *resCode)
void SECU_printCertProblems(FILE *outfile, CERTCertDBHandle *handle, CERTCertificate *cert, PRBool checksig, SECCertificateUsage certUsage, void *pinArg, PRBool verbose)
void SECU_PrintCRLInfo(FILE *out, CERTCrl *crl, char *m, int level)
SECStatus SECU_ReadDERFromFile(SECItem *der, PRFileDesc *inFile, PRBool ascii)
char * data
Definition: secutil.h:84
SECItem * SECU_GetPBEPassword(void *arg)
char * SEC_GetPassword(FILE *in, FILE *out, char *msg, PRBool(*chkpw)(char *))
void SECU_PrintTrustFlags(FILE *out, CERTCertTrust *trust, char *m, int level)
SignAndEncodeFuncExitStat
Definition: secutil.h:331
SECStatus DER_PrettyPrint(FILE *out, SECItem *it, PRBool raw)
int SECU_CheckCertNameExists(CERTCertDBHandle *handle, char *nickname)
int SECU_PrintCrl(FILE *out, SECItem *der, char *m, int level)
char * SECU_ErrorStringRaw(int16 err)
void SECU_PrintSystemError(char *progName, char *msg,...)
SECStatus SECU_StoreCRL(PK11SlotInfo *slot, SECItem *derCrl, PRFileDesc *outFile, int ascii, char *url)
void SECU_PrintAsHex(FILE *out, SECItem *i, const char *m, int level)
int SECU_PrintPKCS7ContentInfo(FILE *out, SECItem *der, char *m, int level)
CERTCertificate * SECU_FindCrlIssuer(CERTCertDBHandle *dbHandle, SECItem *subject, CERTAuthKeyID *id, PRTime validTime)
void SECU_PrintAny(FILE *out, SECItem *i, char *m, int level)
SECStatus SECU_FileToItem(SECItem *dst, PRFileDesc *src)
CERTAuthKeyID * SECU_FindCRLAuthKeyIDExten(PRArenaPool *arena, CERTSignedCrl *crl)
SECStatus SECU_ParseCommandLine(int argc, char **argv, char *progName, secuCommand *cmd)
void SECU_PrintUTCTime(FILE *out, SECItem *t, char *m, int level)
char * SECU_FilePasswd(PK11SlotInfo *slot, PRBool retry, void *arg)
char * arg
Definition: secutil.h:383
void SECU_Indent(FILE *out, int level)
void SECU_PrintTimeChoice(FILE *out, SECItem *t, char *m, int level)
int SECU_PrintSignedData(FILE *out, SECItem *der, char *m, int level, SECU_PPFunc inner)
SECStatus SECU_EncodeAndAddExtensionValue(PRArenaPool *arena, void *extHandle, void *value, PRBool criticality, int extenType, EXTEN_EXT_VALUE_ENCODER EncodeValueFn)
PRBool needsArg
Definition: secutil.h:382
void SECU_PrintExtensions(FILE *out, CERTCertExtension **extensions, char *msg, int level)
void SECU_PrintBuf(FILE *out, const char *msg, const void *vp, int len)
void SECU_PrintPrivKeyUsagePeriodExtension(FILE *out, SECItem *value, char *msg, int level)
int SECU_PrintCertificateRequest(FILE *out, SECItem *der, char *m, int level)
int SECU_PrintCertificate(FILE *out, SECItem *der, char *m, int level)
void printflags(char *trusts, unsigned int flags)
void SECU_PrintPRandOSError(char *progName)
int(* SECU_PPFunc)(FILE *out, SECItem *item, char *msg, int level)
Definition: secutil.h:74
void SEC_Init(void)
int SECU_GetClientAuthData(void *arg, PRFileDesc *fd, struct CERTDistNamesStr *caNames, struct CERTCertificateStr **pRetCert, struct SECKEYPrivateKeyStr **pRetKey)
secuCommandFlag * commands
Definition: secutil.h:393
char * SECU_AppendFilenameToDir(char *dir, char *filename)
secuCommandFlag * options
Definition: secutil.h:394
void SECU_PrintError(char *progName, char *msg,...)
SECStatus SECU_CopyCRL(PRArenaPool *destArena, CERTCrl *destCrl, CERTCrl *srcCrl)
SECOidTag SECU_PrintObjectID(FILE *out, SECItem *oid, char *m, int level)
char * SECU_SECModDBName(void)
SECStatus SEC_WriteDongleFile(int fd, char *pw)
PRBool SEC_CheckPassword(char *password)
int SECU_PrintFingerprints(FILE *out, SECItem *derCert, char *m, int level)
char * SECU_DefaultSSLDir(void)
void SECU_PrintName(FILE *out, CERTName *name, char *msg, int level)
void SECU_PrintGeneralizedTime(FILE *out, SECItem *t, char *m, int level)
Definition: secutil.h:336
PRBool activated
Definition: secutil.h:384
SECStatus SECU_PrintCertificateNames(CERTCertDBHandle *handle, PRFileDesc *out, PRBool sortByName, PRBool sortByTrust)
SECStatus SECU_DerSignDataCRL(PRArenaPool *arena, CERTSignedData *sd, unsigned char *buf, int len, SECKEYPrivateKey *pk, SECOidTag algID)
int ffs(unsigned int i)
SECStatus SECU_TextFileToItem(SECItem *dst, PRFileDesc *src)
SECStatus(* EXTEN_EXT_VALUE_ENCODER)(PRArenaPool *extHandleArena, void *value, SECItem *encodedValue)
Definition: secutil.h:363
SECStatus SECU_PrintCertNickname(CERTCertListNode *cert, void *data)
char * SECU_GetOptionArg(secuCommand *cmd, int optionNum)
int numOptions
Definition: secutil.h:391
PRBool SEC_BlindCheckPassword(char *password)
void SECU_PrintInteger(FILE *out, SECItem *i, char *m, int level)
SECOidTag SECU_StringToSignatureAlgTag(const char *alg)
SECStatus SECU_PKCS11Init(PRBool readOnly)
int numCommands
Definition: secutil.h:390
char * SECU_ConfigDirectory(const char *base)
char * SECU_ErrorString(int16 err)
void SECU_PrintAlgorithmID(FILE *out, SECAlgorithmID *a, char *m, int level)
void SECU_PrintString(FILE *out, SECItem *si, char *m, int level)
char * SECU_GetModulePassword(PK11SlotInfo *slot, PRBool retry, void *arg)
SECStatus SECU_ChangePW(PK11SlotInfo *slot, char *passwd, char *pwFile)
SECStatus SECU_RegisterDynamicOids(void)
char * SECU_GetPasswordString(void *arg, char *prompt)
char * SEC_ReadDongleFile(int fd)