Back to index

lightning-sunbird  0.9+nobinonly
Classes | Typedefs | Functions
xconst.h File Reference
#include "certt.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CERTAltNameEncodedContextStr

Typedefs

typedef struct
CERTAltNameEncodedContextStr 
CERTAltNameEncodedContext

Functions

SEC_BEGIN_PROTOS SECStatus CERT_EncodePrivateKeyUsagePeriod (PRArenaPool *arena, CERTPrivKeyUsagePeriod *pkup, SECItem *encodedValue)
SECStatus CERT_EncodeNameConstraintsExtension (PRArenaPool *arena, CERTNameConstraints *value, SECItem *encodedValue)
SECStatus CERT_EncodeSubjectKeyID (PRArenaPool *arena, char *value, int len, SECItem *encodedValue)
SECStatus CERT_EncodeIA5TypeExtension (PRArenaPool *arena, char *value, SECItem *encodedValue)
SECStatus cert_EncodeAuthInfoAccessExtension (PRArenaPool *arena, CERTAuthInfoAccess **info, SECItem *dest)

Class Documentation

struct CERTAltNameEncodedContextStr

Definition at line 41 of file xconst.h.

Class Members
SECItem ** encodedGenName

Typedef Documentation


Function Documentation

SECStatus cert_EncodeAuthInfoAccessExtension ( PRArenaPool arena,
CERTAuthInfoAccess **  info,
SECItem *  dest 
)

Definition at line 273 of file xconst.c.

{
    SECItem *dummy;
    int i;

    PORT_Assert(info != NULL);
    PORT_Assert(dest != NULL);
    if (info == NULL || dest == NULL) {
       return SECFailure;
    }

    for (i = 0; info[i] != NULL; i++) {
       if (CERT_EncodeGeneralName(info[i]->location, &(info[i]->derLocation),
                               arena) == NULL)
           /* Note that this may leave some of the locations filled in. */
           return SECFailure;
    }
    dummy = SEC_ASN1EncodeItem(arena, dest, &info,
                            CERTAuthInfoAccessTemplate);
    if (dummy == NULL) {
       return SECFailure;
    }
    return SECSuccess;
}
SECStatus CERT_EncodeIA5TypeExtension ( PRArenaPool arena,
char *  value,
SECItem *  encodedValue 
)

Definition at line 172 of file xconst.c.

{
    SECItem encodeContext;
    SECStatus rv = SECSuccess;


    PORT_Memset (&encodeContext, 0, sizeof (encodeContext));
    
    if (value != NULL) {
       encodeContext.data = (unsigned char *)value;
       encodeContext.len = strlen(value);
    }
    if (SEC_ASN1EncodeItem (arena, encodedValue, &encodeContext,
                         CERTIA5TypeTemplate) == NULL) {
       rv = SECFailure;
    }
    
    return(rv);
}
SECStatus CERT_EncodeNameConstraintsExtension ( PRArenaPool arena,
CERTNameConstraints *  value,
SECItem *  encodedValue 
)

Definition at line 231 of file xconst.c.

{
    SECStatus     rv = SECSuccess;
    
    rv = cert_EncodeNameConstraints(value, arena, encodedValue);
    return rv;
}
SEC_BEGIN_PROTOS SECStatus CERT_EncodePrivateKeyUsagePeriod ( PRArenaPool arena,
CERTPrivKeyUsagePeriod *  pkup,
SECItem *  encodedValue 
)

Definition at line 123 of file xconst.c.

{
    SECStatus rv = SECSuccess;

    if (SEC_ASN1EncodeItem (arena, encodedValue, pkup,
                         CERTPrivateKeyUsagePeriodTemplate) == NULL) {
       rv = SECFailure;
    }
    return(rv);
}
SECStatus CERT_EncodeSubjectKeyID ( PRArenaPool arena,
char *  value,
int  len,
SECItem *  encodedValue 
)

Definition at line 101 of file xconst.c.

{
    SECItem encodeContext;
    SECStatus rv = SECSuccess;


    PORT_Memset (&encodeContext, 0, sizeof (encodeContext));
    
    if (value != NULL) {
       encodeContext.data = (unsigned char *)value;
       encodeContext.len = len;
    }
    if (SEC_ASN1EncodeItem (arena, encodedValue, &encodeContext,
                         CERTSubjectKeyIDTemplate) == NULL) {
       rv = SECFailure;
    }
    
    return(rv);
}