pam_pkcs11 0.6.8

- Main Page
- Data Structures
- Files
- Directories

- File List
- Globals

Data Structures | Defines | Typedefs | Enumerations | Functions
secutil.h File Reference
`#include "seccomon.h"`
`#include "secitem.h"`
`#include "prerror.h"`
`#include "base64.h"`
`#include "key.h"`
`#include "secpkcs7.h"`
`#include "secasn1.h"`
`#include "secder.h"`
`#include <stdio.h>`
`#include "secerr.h"`
`#include "sslerr.h"`

Go to the source code of this file.

## Data Structures

struct | secuPWData
struct | secuCommandFlag
struct | secuCommand

## Defines

#define | SEC_CT_PRIVATE_KEY "private-key"
#define | SEC_CT_PUBLIC_KEY "public-key"
#define | SEC_CT_CERTIFICATE "certificate"
#define | SEC_CT_CERTIFICATE_REQUEST "certificate-request"
#define | SEC_CT_PKCS7 "pkcs7"
#define | SEC_CT_CRL "crl"
#define | NS_CERTREQ_HEADER "-----BEGIN NEW CERTIFICATE REQUEST-----"
#define | NS_CERTREQ_TRAILER "-----END NEW CERTIFICATE REQUEST-----"
#define | NS_CERT_HEADER "-----BEGIN CERTIFICATE-----"
#define | NS_CERT_TRAILER "-----END CERTIFICATE-----"
#define | NS_CRL_HEADER "-----BEGIN CRL-----"
#define | NS_CRL_TRAILER "-----END CRL-----"

## Typedefs

typedef int(* | SECU_PPFunc )(FILE *out, SECItem *item, char *msg, int level)
typedef SECStatus(* | EXTEN_EXT_VALUE_ENCODER )(PRArenaPool *extHandleArena, void *value, SECItem *encodedValue)

## Enumerations

enum | SignAndEncodeFuncExitStat { noKeyFound = 1, noSignatureMatch = 2, failToEncode = 3, failToSign = 4, noMem = 5 }

## Functions

SECStatus | SEC_AddPermCertificate (CERTCertDBHandle *handle, SECItem *derCert, char *nickname, CERTCertTrust *trust)
SECStatus | SECU_ChangePW (PK11SlotInfo *slot, char *passwd, char *pwFile)
PRBool | SEC_CheckPassword (char *password)
PRBool | SEC_BlindCheckPassword (char *password)
char * | SEC_GetPassword (FILE *in, FILE *out, char *msg, PRBool(*chkpw)(char *))
char * | SECU_FilePasswd (PK11SlotInfo *slot, PRBool retry, void *arg)
char * | SECU_GetPasswordString (void *arg, char *prompt)
SECStatus | SEC_WriteDongleFile (int fd, char *pw)
char * | SEC_ReadDongleFile (int fd)
char * | SECU_AppendFilenameToDir (char *dir, char *filename)
char * | SECU_DefaultSSLDir (void)
char * | SECU_ConfigDirectory (const char *base)
int | SECU_GetClientAuthData (void *arg, PRFileDesc *fd, struct CERTDistNamesStr *caNames, struct CERTCertificateStr **pRetCert, struct SECKEYPrivateKeyStr **pRetKey)
void | SECU_PrintError (char *progName, char *msg,...)
void | SECU_PrintSystemError (char *progName, char *msg,...)
const char * | SECU_Strerror (PRErrorCode errNum)
void | SECU_printCertProblems (FILE *outfile, CERTCertDBHandle *handle, CERTCertificate *cert, PRBool checksig, SECCertificateUsage certUsage, void *pinArg, PRBool verbose)
SECStatus | SECU_FileToItem (SECItem *dst, PRFileDesc *src)
SECStatus | SECU_TextFileToItem (SECItem *dst, PRFileDesc *src)
SECStatus | SECU_ReadDERFromFile (SECItem *der, PRFileDesc *inFile, PRBool ascii)
void | SECU_Indent (FILE *out, int level)
void | SECU_PrintInteger (FILE *out, SECItem *i, char *m, int level)
SECOidTag | SECU_PrintObjectID (FILE *out, SECItem *oid, char *m, int level)
void | SECU_PrintAlgorithmID (FILE *out, SECAlgorithmID *a, char *m, int level)
void | SECU_PrintAsHex (FILE *out, SECItem *i, const char *m, int level)
void | SECU_PrintBuf (FILE *out, const char *msg, const void *vp, int len)
void | SECU_PrintUTCTime (FILE *out, SECItem *t, char *m, int level)
void | SECU_PrintGeneralizedTime (FILE *out, SECItem *t, char *m, int level)
void | SECU_PrintTimeChoice (FILE *out, SECItem *t, char *m, int level)
SECStatus | SECU_PrintCertNickname (CERTCertListNode *cert, void *data)
SECStatus | SECU_PrintCertificateNames (CERTCertDBHandle *handle, PRFileDesc *out, PRBool sortByName, PRBool sortByTrust)
int | SECU_CheckCertNameExists (CERTCertDBHandle *handle, char *nickname)
int | SECU_PrintCertificateRequest (FILE *out, SECItem *der, char *m, int level)
int | SECU_PrintCertificate (FILE *out, SECItem *der, char *m, int level)
void | SECU_PrintTrustFlags (FILE *out, CERTCertTrust *trust, char *m, int level)
int | SECU_PrintPublicKey (FILE *out, SECItem *der, char *m, int level)
int | SECU_PrintFingerprints (FILE *out, SECItem *derCert, char *m, int level)
int | SECU_PrintPKCS7ContentInfo (FILE *out, SECItem *der, char *m, int level)
SECStatus | SECU_PKCS11Init (PRBool readOnly)
int | SECU_PrintSignedData (FILE *out, SECItem *der, char *m, int level, SECU_PPFunc inner)
int | SECU_PrintCrl (FILE *out, SECItem *der, char *m, int level)
void | SECU_PrintCRLInfo (FILE *out, CERTCrl *crl, char *m, int level)
void | SECU_PrintString (FILE *out, SECItem *si, char *m, int level)
void | SECU_PrintAny (FILE *out, SECItem *i, char *m, int level)
void | SECU_PrintPolicy (FILE *out, SECItem *value, char *msg, int level)
void | SECU_PrintPrivKeyUsagePeriodExtension (FILE *out, SECItem *value, char *msg, int level)
void | SECU_PrintExtensions (FILE *out, CERTCertExtension **extensions, char *msg, int level)
void | SECU_PrintName (FILE *out, CERTName *name, char *msg, int level)
SECItem * | SECU_GetPBEPassword (void *arg)
char * | SECU_GetModulePassword (PK11SlotInfo *slot, PRBool retry, void *arg)
SECStatus | DER_PrettyPrint (FILE *out, SECItem *it, PRBool raw)
void | SEC_Init (void)
char * | SECU_SECModDBName (void)
void | SECU_PrintPRandOSError (char *progName)
SECStatus | SECU_RegisterDynamicOids (void)
SECOidTag | SECU_StringToSignatureAlgTag (const char *alg)
SECStatus | SECU_StoreCRL (PK11SlotInfo *slot, SECItem *derCrl, PRFileDesc *outFile, int ascii, char *url)
SECStatus | SECU_DerSignDataCRL (PRArenaPool *arena, CERTSignedData *sd, unsigned char *buf, int len, SECKEYPrivateKey *pk, SECOidTag algID)
SECStatus | SECU_SignAndEncodeCRL (CERTCertificate *issuer, CERTSignedCrl *signCrl, SECOidTag hashAlgTag, SignAndEncodeFuncExitStat *resCode)
SECStatus | SECU_CopyCRL (PRArenaPool *destArena, CERTCrl *destCrl, CERTCrl *srcCrl)
CERTAuthKeyID * | SECU_FindCRLAuthKeyIDExten (PRArenaPool *arena, CERTSignedCrl *crl)
CERTCertificate * | SECU_FindCrlIssuer (CERTCertDBHandle *dbHandle, SECItem *subject, CERTAuthKeyID *id, PRTime validTime)
SECStatus | SECU_EncodeAndAddExtensionValue (PRArenaPool *arena, void *extHandle, void *value, PRBool criticality, int extenType, EXTEN_EXT_VALUE_ENCODER EncodeValueFn)
SECStatus | SECU_ParseCommandLine (int argc, char **argv, char *progName, secuCommand *cmd)
char * | SECU_GetOptionArg (secuCommand *cmd, int optionNum)
char * | SECU_ErrorString (int16 err)
char * | SECU_ErrorStringRaw (int16 err)
void | printflags (char *trusts, unsigned int flags)
int | ffs (unsigned int i)

## Define Documentation

#define NS_CERT_HEADER "-----BEGIN CERTIFICATE-----"

Definition at line 59 of file secutil.h.

#define NS_CERT_TRAILER "-----END CERTIFICATE-----"

Definition at line 60 of file secutil.h.

#define NS_CERTREQ_HEADER "-----BEGIN NEW CERTIFICATE REQUEST-----"

Definition at line 56 of file secutil.h.

#define NS_CERTREQ_TRAILER "-----END NEW CERTIFICATE REQUEST-----"

Definition at line 57 of file secutil.h.

#define NS_CRL_HEADER "-----BEGIN CRL-----"

Definition at line 62 of file secutil.h.

#define NS_CRL_TRAILER "-----END CRL-----"

Definition at line 63 of file secutil.h.

#define SEC_CT_CERTIFICATE "certificate"

Definition at line 51 of file secutil.h.

#define SEC_CT_CERTIFICATE_REQUEST "certificate-request"

Definition at line 52 of file secutil.h.

#define SEC_CT_CRL "crl"

Definition at line 54 of file secutil.h.

#define SEC_CT_PKCS7 "pkcs7"

Definition at line 53 of file secutil.h.

#define SEC_CT_PRIVATE_KEY "private-key"

Definition at line 49 of file secutil.h.

#define SEC_CT_PUBLIC_KEY "public-key"

Definition at line 50 of file secutil.h.

## Typedef Documentation

typedef SECStatus(* EXTEN_EXT_VALUE_ENCODER)(PRArenaPool *extHandleArena, void *value, SECItem *encodedValue)

Definition at line 363 of file secutil.h.

typedef int(* SECU_PPFunc)(FILE *out, SECItem *item, char *msg, int level)

Definition at line 74 of file secutil.h.

## Enumeration Type Documentation

enum SignAndEncodeFuncExitStat

Enumerator:

  noKeyFound |
  noSignatureMatch |
  failToEncode |
  failToSign |
  noMem |

Definition at line 331 of file secutil.h.

## Function Documentation

SECStatus DER_PrettyPrint | ( | FILE * | out,
|  | SECItem * | it,
|  | PRBool | raw
| ) |  |

int ffs | ( | unsigned int | i | ) |

void printflags | ( | char * | trusts,
|  | unsigned int | flags
| ) |  |

SECStatus SEC_AddPermCertificate | ( | CERTCertDBHandle * | handle,
|  | SECItem * | derCert,
|  | char * | nickname,
|  | CERTCertTrust * | trust
| ) |  |

PRBool SEC_BlindCheckPassword | ( | char * | password | ) |

PRBool SEC_CheckPassword | ( | char * | password | ) |

char* SEC_GetPassword | ( | FILE * | in,
|  | FILE * | out,
|  | char * | msg,
|  | PRBool(*)(char *) | chkpw
| ) |  |

void SEC_Init | ( | void |  | ) |

char* SEC_ReadDongleFile | ( | int | fd | ) |

SECStatus SEC_WriteDongleFile | ( | int | fd,
|  | char * | pw
| ) |  |

char* SECU_AppendFilenameToDir | ( | char * | dir,
|  | char * | filename
| ) |  |

SECStatus SECU_ChangePW | ( | PK11SlotInfo * | slot,
|  | char * | passwd,
|  | char * | pwFile
| ) |  |

int SECU_CheckCertNameExists | ( | CERTCertDBHandle * | handle,
|  | char * | nickname
| ) |  |

char* SECU_ConfigDirectory | ( | const char * | base | ) |

SECStatus SECU_CopyCRL | ( | PRArenaPool * | destArena,
|  | CERTCrl * | destCrl,
|  | CERTCrl * | srcCrl
| ) |  |

char* SECU_DefaultSSLDir | ( | void |  | ) |

SECStatus SECU_DerSignDataCRL | ( | PRArenaPool * | arena,
|  | CERTSignedData * | sd,
|  | unsigned char * | buf,
|  | int | len,
|  | SECKEYPrivateKey * | pk,
|  | SECOidTag | algID
| ) |  |

SECStatus SECU_EncodeAndAddExtensionValue | ( | PRArenaPool * | arena,
|  | void * | extHandle,
|  | void * | value,
|  | PRBool | criticality,
|  | int | extenType,
|  | EXTEN_EXT_VALUE_ENCODER | EncodeValueFn
| ) |  |

char* SECU_ErrorString | ( | int16 | err | ) |

char* SECU_ErrorStringRaw | ( | int16 | err | ) |

char* SECU_FilePasswd | ( | PK11SlotInfo * | slot,
|  | PRBool | retry,
|  | void * | arg
| ) |  |

SECStatus SECU_FileToItem | ( | SECItem * | dst,
|  | PRFileDesc * | src
| ) |  |

CERTAuthKeyID* SECU_FindCRLAuthKeyIDExten | ( | PRArenaPool * | arena,
|  | CERTSignedCrl * | crl
| ) |  |

CERTCertificate* SECU_FindCrlIssuer | ( | CERTCertDBHandle * | dbHandle,
|  | SECItem * | subject,
|  | CERTAuthKeyID * | id,
|  | PRTime | validTime
| ) |  |

int SECU_GetClientAuthData | ( | void * | arg,
|  | PRFileDesc * | fd,
|  | struct CERTDistNamesStr * | caNames,
|  | struct CERTCertificateStr ** | pRetCert,
|  | struct SECKEYPrivateKeyStr ** | pRetKey
| ) |  |

char* SECU_GetModulePassword | ( | PK11SlotInfo * | slot,
|  | PRBool | retry,
|  | void * | arg
| ) |  |

char* SECU_GetOptionArg | ( | secuCommand * | cmd,
|  | int | optionNum
| ) |  |

char* SECU_GetPasswordString | ( | void * | arg,
|  | char * | prompt
| ) |  |

SECItem* SECU_GetPBEPassword | ( | void * | arg | ) |

void SECU_Indent | ( | FILE * | out,
|  | int | level
| ) |  |

SECStatus SECU_ParseCommandLine | ( | int | argc,
|  | char ** | argv,
|  | char * | progName,
|  | secuCommand * | cmd
| ) |  |

SECStatus SECU_PKCS11Init | ( | PRBool | readOnly | ) |

void SECU_PrintAlgorithmID | ( | FILE * | out,
|  | SECAlgorithmID * | a,
|  | char * | m,
|  | int | level
| ) |  |

void SECU_PrintAny | ( | FILE * | out,
|  | SECItem * | i,
|  | char * | m,
|  | int | level
| ) |  |

void SECU_PrintAsHex | ( | FILE * | out,
|  | SECItem * | i,
|  | const char * | m,
|  | int | level
| ) |  |

void SECU_PrintBuf | ( | FILE * | out,
|  | const char * | msg,
|  | const void * | vp,
|  | int | len
| ) |  |

int SECU_PrintCertificate | ( | FILE * | out,
|  | SECItem * | der,
|  | char * | m,
|  | int | level
| ) |  |

SECStatus SECU_PrintCertificateNames | ( | CERTCertDBHandle * | handle,
|  | PRFileDesc * | out,
|  | PRBool | sortByName,
|  | PRBool | sortByTrust
| ) |  |

int SECU_PrintCertificateRequest | ( | FILE * | out,
|  | SECItem * | der,
|  | char * | m,
|  | int | level
| ) |  |

SECStatus SECU_PrintCertNickname | ( | CERTCertListNode * | cert,
|  | void * | data
| ) |  |

void SECU_printCertProblems | ( | FILE * | outfile,
|  | CERTCertDBHandle * | handle,
|  | CERTCertificate * | cert,
|  | PRBool | checksig,
|  | SECCertificateUsage | certUsage,
|  | void * | pinArg,
|  | PRBool | verbose
| ) |  |

int SECU_PrintCrl | ( | FILE * | out,
|  | SECItem * | der,
|  | char * | m,
|  | int | level
| ) |  |

void SECU_PrintCRLInfo | ( | FILE * | out,
|  | CERTCrl * | crl,
|  | char * | m,
|  | int | level
| ) |  |

void SECU_PrintError | ( | char * | progName,
|  | char * | msg,
|  |  | ...
| ) |  |

void SECU_PrintExtensions | ( | FILE * | out,
|  | CERTCertExtension ** | extensions,
|  | char * | msg,
|  | int | level
| ) |  |

int SECU_PrintFingerprints | ( | FILE * | out,
|  | SECItem * | derCert,
|  | char * | m,
|  | int | level
| ) |  |

void SECU_PrintGeneralizedTime | ( | FILE * | out,
|  | SECItem * | t,
|  | char * | m,
|  | int | level
| ) |  |

void SECU_PrintInteger | ( | FILE * | out,
|  | SECItem * | i,
|  | char * | m,
|  | int | level
| ) |  |

void SECU_PrintName | ( | FILE * | out,
|  | CERTName * | name,
|  | char * | msg,
|  | int | level
| ) |  |

SECOidTag SECU_PrintObjectID | ( | FILE * | out,
|  | SECItem * | oid,
|  | char * | m,
|  | int | level
| ) |  |

int SECU_PrintPKCS7ContentInfo | ( | FILE * | out,
|  | SECItem * | der,
|  | char * | m,
|  | int | level
| ) |  |

void SECU_PrintPolicy | ( | FILE * | out,
|  | SECItem * | value,
|  | char * | msg,
|  | int | level
| ) |  |

void SECU_PrintPRandOSError | ( | char * | progName | ) |

void SECU_PrintPrivKeyUsagePeriodExtension | ( | FILE * | out,
|  | SECItem * | value,
|  | char * | msg,
|  | int | level
| ) |  |

int SECU_PrintPublicKey | ( | FILE * | out,
|  | SECItem * | der,
|  | char * | m,
|  | int | level
| ) |  |

int SECU_PrintSignedData | ( | FILE * | out,
|  | SECItem * | der,
|  | char * | m,
|  | int | level,
|  | SECU_PPFunc | inner
| ) |  |

void SECU_PrintString | ( | FILE * | out,
|  | SECItem * | si,
|  | char * | m,
|  | int | level
| ) |  |

void SECU_PrintSystemError | ( | char * | progName,
|  | char * | msg,
|  |  | ...
| ) |  |

void SECU_PrintTimeChoice | ( | FILE * | out,
|  | SECItem * | t,
|  | char * | m,
|  | int | level
| ) |  |

void SECU_PrintTrustFlags | ( | FILE * | out,
|  | CERTCertTrust * | trust,
|  | char * | m,
|  | int | level
| ) |  |

void SECU_PrintUTCTime | ( | FILE * | out,
|  | SECItem * | t,
|  | char * | m,
|  | int | level
| ) |  |

SECStatus SECU_ReadDERFromFile | ( | SECItem * | der,
|  | PRFileDesc * | inFile,
|  | PRBool | ascii
| ) |  |

SECStatus SECU_RegisterDynamicOids | ( | void |  | ) |

char* SECU_SECModDBName | ( | void |  | ) |

SECStatus SECU_SignAndEncodeCRL | ( | CERTCertificate * | issuer,
|  | CERTSignedCrl * | signCrl,
|  | SECOidTag | hashAlgTag,
|  | SignAndEncodeFuncExitStat * | resCode
| ) |  |

SECStatus SECU_StoreCRL | ( | PK11SlotInfo * | slot,
|  | SECItem * | derCrl,
|  | PRFileDesc * | outFile,
|  | int | ascii,
|  | char * | url
| ) |  |

const char* SECU_Strerror | ( | PRErrorCode | errNum | ) |

SECOidTag SECU_StringToSignatureAlgTag | ( | const char * | alg | ) |

SECStatus SECU_TextFileToItem | ( | SECItem * | dst,
|  | PRFileDesc * | src
| ) |  |