/*******************************************************************
 *
 * This file was generated by TIS/ASN1COMP Ver. 4.2, an ASN.1 compiler.
 * TIS/ASN1COMP is Copyright (c) 1998, TIS Labs at Network Associates, Inc.
 *
 * This file was AUTOMATICALLY GENERATED on Tue May 18 17:09:44 1999
 *
 ******************************************************************/

#ifndef pgpX509Cert_STRUCT_H_
#define pgpX509Cert_STRUCT_H_

#include "pgpX509Cert_util.h"
#include "pgpX509Cert_sizes.h"


/*******************************************************************
 *
 * Structure and type definitions
 *
 ******************************************************************/


typedef PGPASN_OBJECT_ID   PGPASN_AttributeType;
#define PGPASN_ID_AttributeType PGPASN_ID_OBJECT_ID

typedef PGPASN_ANY   PGPASN_AttributeValue;
#define PGPASN_ID_AttributeValue PGPASN_ID_ANY

typedef PGPASN_OCTET_STRING PGPASN_BMPString;
#define PGPASN_ID_BMPString 0x1e

typedef PGPASN_INTEGER   PGPASN_CertificateSerialNumber;
#define PGPASN_ID_CertificateSerialNumber PGPASN_ID_INTEGER

typedef PGPASN_OBJECT_ID   PGPASN_ContentType;
#define PGPASN_ID_ContentType PGPASN_ID_OBJECT_ID

typedef PGPASN_INTEGER   PGPASN_DSAPublicKey;
#define PGPASN_ID_DSAPublicKey PGPASN_ID_INTEGER

typedef PGPASN_OCTET_STRING   PGPASN_Data;
#define PGPASN_ID_Data PGPASN_ID_OCTET_STRING

typedef PGPASN_INTEGER   PGPASN_ELGPublicKey;
#define PGPASN_ID_ELGPublicKey PGPASN_ID_INTEGER

typedef PGPASN_OCTET_STRING   PGPASN_EncryptedDigest;
#define PGPASN_ID_EncryptedDigest PGPASN_ID_OCTET_STRING

typedef PGPASN_BIT_STRING PGPASN_KeyUsage;
#define PGPASN_ID_KeyUsage PGPASN_ID_BIT_STRING

/* define bits for PGPASN_KeyUsage */
#define PGPASN_KeyUsage_cRLSign 0x40	/* bit 6 */
#define PGPASN_KeyUsage_dataEncipherment 0x8	/* bit 3 */
#define PGPASN_KeyUsage_decipherOnly 0x100	/* bit 8 */
#define PGPASN_KeyUsage_digitalSignature 0x1	/* bit 0 */
#define PGPASN_KeyUsage_encipherOnly 0x80	/* bit 7 */
#define PGPASN_KeyUsage_keyAgreement 0x10	/* bit 4 */
#define PGPASN_KeyUsage_keyCertSign 0x20	/* bit 5 */
#define PGPASN_KeyUsage_keyEncipherment 0x4	/* bit 2 */
#define PGPASN_KeyUsage_nonRepudiation 0x2	/* bit 1 */
/* end of bits for PGPASN_KeyUsage */

typedef PGPASN_OCTET_STRING   PGPASN_PrivateKey;
#define PGPASN_ID_PrivateKey PGPASN_ID_OCTET_STRING

typedef PGPASN_BIT_STRING PGPASN_ReasonFlags;
#define PGPASN_ID_ReasonFlags PGPASN_ID_BIT_STRING

/* define bits for PGPASN_ReasonFlags */
#define PGPASN_ReasonFlags_affiliationChanged 0x8	/* bit 3 */
#define PGPASN_ReasonFlags_cACompromise 0x4	/* bit 2 */
#define PGPASN_ReasonFlags_certificateHold 0x40	/* bit 6 */
#define PGPASN_ReasonFlags_cessationOfOperation 0x20	/* bit 5 */
#define PGPASN_ReasonFlags_keyCompromise 0x2	/* bit 1 */
#define PGPASN_ReasonFlags_superseded 0x10	/* bit 4 */
#define PGPASN_ReasonFlags_unused 0x1	/* bit 0 */
/* end of bits for PGPASN_ReasonFlags */

typedef PGPASN_BIT_STRING   PGPASN_Signature;
#define PGPASN_ID_Signature PGPASN_ID_BIT_STRING

typedef PGPASN_OCTET_STRING PGPASN_UTF8String;
#define PGPASN_ID_UTF8String 0x0c

typedef PGPASN_BIT_STRING   PGPASN_UniqueIdentifier;
#define PGPASN_ID_UniqueIdentifier PGPASN_ID_BIT_STRING

typedef PGPASN_OCTET_STRING PGPASN_UniversalString;
#define PGPASN_ID_UniversalString 0x1c

typedef PGPASN_INTEGER   PGPASN_Version;
#define PGPASN_ID_Version PGPASN_ID_INTEGER

typedef struct {
    PGPASN_OBJECT_ID  algorithm;
    PGPASN_ANY *parameters;
} PGPASN_AlgorithmIdentifier;
#define PGPASN_ID_AlgorithmIdentifier PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_AttributeType  type;
    PGPASN_AttributeValue  value;
} PGPASN_AttributeTypeAndValue;
#define PGPASN_ID_AttributeTypeAndValue PGPASN_ID_SEQUENCE

typedef struct {
    long  n;          /* number of elements */
    PGPASN_AttributeValue *elt[ PGPASN_MAX_AttributeValues ];
} PGPASN_AttributeValues;
#define PGPASN_ID_AttributeValues PGPASN_ID_SET_OF

typedef struct {
    PGPASN_BOOLEAN *cA;
    PGPASN_INTEGER *pathLenConstraint;
} PGPASN_BasicConstraints;
#define PGPASN_ID_BasicConstraints PGPASN_ID_SEQUENCE

typedef struct {
    unsigned char CHOICE_field_type;
    void *data;
} PGPASN_CertificateValidityDate;
#define PGPASN_ID_CertificateValidityDate PGPASN_ID_CHOICE
/* tags for fields defined for CertificateValidityDate */
#define PGPASN_utcTime_CertificateValidityDateFieldTag PGPASN_ID_UTCTime
#define PGPASN_generalTime_CertificateValidityDateFieldTag PGPASN_ID_GeneralizedTime

typedef struct {
    PGPASN_ContentType  contentType;
    PGPASN_ANY *content;
} PGPASN_ContentInfo;
#define PGPASN_ID_ContentInfo PGPASN_ID_SEQUENCE

typedef struct {
    unsigned char CHOICE_field_type;
    void *data;
} PGPASN_DirectoryString;
#define PGPASN_ID_DirectoryString PGPASN_ID_CHOICE
/* tags for fields defined for DirectoryString */
#define PGPASN_teletexString_DirectoryStringFieldTag PGPASN_ID_T61String
#define PGPASN_printableString_DirectoryStringFieldTag PGPASN_ID_PrintableString
#define PGPASN_universalString_DirectoryStringFieldTag PGPASN_ID_UniversalString
#define PGPASN_utf8String_DirectoryStringFieldTag PGPASN_ID_UTF8String
#define PGPASN_bmpString_DirectoryStringFieldTag PGPASN_ID_BMPString
#define PGPASN_ia5String_DirectoryStringFieldTag PGPASN_ID_IA5String

typedef struct {
    PGPASN_INTEGER  p;
    PGPASN_INTEGER  q;
    PGPASN_INTEGER  g;
} PGPASN_DssParms;
#define PGPASN_ID_DssParms PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_INTEGER  r;
    PGPASN_INTEGER  s;
} PGPASN_DssSigValue;
#define PGPASN_ID_DssSigValue PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_INTEGER  p;
    PGPASN_INTEGER  g;
} PGPASN_ELGParms;
#define PGPASN_ID_ELGParms PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_OBJECT_ID  extnID;
    PGPASN_BOOLEAN *critical;
    PGPASN_OCTET_STRING  extnValue;
} PGPASN_Extension;
#define PGPASN_ID_Extension PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_OBJECT_ID  type_id;
    PGPASN_ANY  value;
} PGPASN_OtherName;
#define PGPASN_ID_OtherName PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_INTEGER  modulus;
    PGPASN_INTEGER  exponent;
} PGPASN_RSAKey;
#define PGPASN_ID_RSAKey PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_Version  version;
    PGPASN_INTEGER  modulus;
    PGPASN_INTEGER  publicExponent;
    PGPASN_INTEGER  privateExponent;
    PGPASN_INTEGER  prime1;
    PGPASN_INTEGER  prime2;
    PGPASN_INTEGER  exponent1;
    PGPASN_INTEGER  exponent2;
    PGPASN_INTEGER  coefficient;
} PGPASN_RSAPrivateKey;
#define PGPASN_ID_RSAPrivateKey PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_ANY  issuer;
    PGPASN_CertificateSerialNumber  serialNumber;
} PGPASN_XIssuerAndSerialNumber;
#define PGPASN_ID_XIssuerAndSerialNumber PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_ANY  tbsCertificate;
    PGPASN_ANY  signatureAlgorithm;
    PGPASN_ANY  signature;
} PGPASN_XXCertificate;
#define PGPASN_ID_XXCertificate PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_AttributeType  type;
    PGPASN_AttributeValues  values;
} PGPASN_Attribute;
#define PGPASN_ID_Attribute PGPASN_ID_SEQUENCE

typedef PGPASN_AlgorithmIdentifier PGPASN_ContentEncryptionAlgorithmIdentifier;
#define PGPASN_ID_ContentEncryptionAlgorithmIdentifier PGPASN_ID_AlgorithmIdentifier

typedef PGPASN_AlgorithmIdentifier PGPASN_DigestAlgorithmIdentifier;
#define PGPASN_ID_DigestAlgorithmIdentifier PGPASN_ID_AlgorithmIdentifier

typedef PGPASN_AlgorithmIdentifier PGPASN_DigestEncryptionAlgorithmIdentifier;
#define PGPASN_ID_DigestEncryptionAlgorithmIdentifier PGPASN_ID_AlgorithmIdentifier

typedef struct {
    long  n;          /* number of elements */
    PGPASN_Extension *elt[ PGPASN_MAX_Extensions ];
} PGPASN_Extensions;
#define PGPASN_ID_Extensions PGPASN_ID_SEQUENCE_OF

typedef PGPASN_AlgorithmIdentifier PGPASN_KeyEncryptionAlgorithmIdentifier;
#define PGPASN_ID_KeyEncryptionAlgorithmIdentifier PGPASN_ID_AlgorithmIdentifier

typedef PGPASN_AlgorithmIdentifier PGPASN_PrivateKeyAlgorithmIdentifier;
#define PGPASN_ID_PrivateKeyAlgorithmIdentifier PGPASN_ID_AlgorithmIdentifier

typedef struct {
    long  n;          /* number of elements */
    PGPASN_AttributeTypeAndValue *elt[ PGPASN_MAX_RelativeDistinguishedName ];
} PGPASN_RelativeDistinguishedName;
#define PGPASN_ID_RelativeDistinguishedName PGPASN_ID_SET_OF

typedef PGPASN_AlgorithmIdentifier PGPASN_SignatureAlgorithmIdentifier;
#define PGPASN_ID_SignatureAlgorithmIdentifier PGPASN_ID_AlgorithmIdentifier

typedef struct {
    PGPASN_AlgorithmIdentifier  algorithm;
    PGPASN_BIT_STRING  subjectPublicKey;
} PGPASN_SubjectPublicKeyInfo;
#define PGPASN_ID_SubjectPublicKeyInfo PGPASN_ID_SEQUENCE

typedef PGPASN_CertificateValidityDate PGPASN_Time;
#define PGPASN_ID_Time PGPASN_ID_CertificateValidityDate

typedef struct {
    PGPASN_CertificateValidityDate  notBefore;
    PGPASN_CertificateValidityDate  notAfter;
} PGPASN_Validity;
#define PGPASN_ID_Validity PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_ANY  tbsCertificate;
    PGPASN_AlgorithmIdentifier  signatureAlgorithm;
    PGPASN_BIT_STRING  signature;
} PGPASN_XCertificate;
#define PGPASN_ID_XCertificate PGPASN_ID_SEQUENCE

typedef struct {
    long  n;          /* number of elements */
    PGPASN_Attribute *elt[ PGPASN_MAX_Attributes ];
} PGPASN_Attributes;
#define PGPASN_ID_Attributes PGPASN_ID_SET_OF

typedef struct {
    long  n;          /* number of elements */
    PGPASN_DigestAlgorithmIdentifier *elt[ PGPASN_MAX_DigestAlgorithmIdentifiers ];
} PGPASN_DigestAlgorithmIdentifiers;
#define PGPASN_ID_DigestAlgorithmIdentifiers PGPASN_ID_SET_OF

typedef struct {
    PGPASN_Version *version;
    PGPASN_Time  keyCreation;
} PGPASN_PGPExtension;
#define PGPASN_ID_PGPExtension PGPASN_ID_SEQUENCE

typedef struct {
    long  n;          /* number of elements */
    PGPASN_RelativeDistinguishedName *elt[ PGPASN_MAX_RDNSequence ];
} PGPASN_RDNSequence;
#define PGPASN_ID_RDNSequence PGPASN_ID_SEQUENCE_OF

typedef struct {
    PGPASN_CertificateSerialNumber  userCertificate;
    PGPASN_Time  revocationDate;
    PGPASN_Extensions *crlEntryExtensions;
} PGPASN_RevokedCertificate;
#define PGPASN_ID_RevokedCertificate PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_Version *version;
    PGPASN_CertificateSerialNumber  serialNumber;
    PGPASN_AlgorithmIdentifier  signature;
    PGPASN_ANY  issuer;
    PGPASN_ANY  validity;
    PGPASN_ANY  subject;
    PGPASN_ANY  subjectPublicKeyInfo;
    PGPASN_UniqueIdentifier *issuerUniqueID;
    PGPASN_UniqueIdentifier *subjectUniqueID;
    PGPASN_Extensions *extensions;
} PGPASN_XTBSCertificate;
#define PGPASN_ID_XTBSCertificate PGPASN_ID_SEQUENCE

typedef struct {
    unsigned char CHOICE_field_type;
    void *data;
} PGPASN_Name;
#define PGPASN_ID_Name PGPASN_ID_CHOICE
/* tags for fields defined for Name */
#define PGPASN_rdnSequence_NameFieldTag PGPASN_ID_RDNSequence

typedef struct {
    PGPASN_Version  version;
    PGPASN_PrivateKeyAlgorithmIdentifier  privateKeyAlgorithm;
    PGPASN_PrivateKey  privateKey;
    PGPASN_Attributes *attributes;
} PGPASN_PrivateKeyInfo;
#define PGPASN_ID_PrivateKeyInfo PGPASN_ID_SEQUENCE

typedef struct {
    long  n;          /* number of elements */
    PGPASN_RevokedCertificate *elt[ PGPASN_MAX_revokedCertificates_SEQ_OF ];
} PGPASN_revokedCertificates_SEQ_OF;
#define PGPASN_ID_revokedCertificates_SEQ_OF PGPASN_ID_SEQUENCE_OF

typedef struct {
    PGPASN_Version  version;
    PGPASN_Name  subject;
    PGPASN_SubjectPublicKeyInfo  subjectPublicKeyInfo;
    PGPASN_Attributes  attributes;
} PGPASN_CertificationRequestInfo;
#define PGPASN_ID_CertificationRequestInfo PGPASN_ID_SEQUENCE

typedef struct {
    unsigned char CHOICE_field_type;
    void *data;
} PGPASN_GeneralName;
#define PGPASN_ID_GeneralName PGPASN_ID_CHOICE
/* tags for fields defined for GeneralName */
#define PGPASN_otherName_GeneralNameFieldTag 0x80|0x20|0x00
#define PGPASN_rfc822Name_GeneralNameFieldTag 0x80|0x20|0x01
#define PGPASN_dNSName_GeneralNameFieldTag 0x80|0x20|0x02
#define PGPASN_directoryName_GeneralNameFieldTag 0x80|0x20|0x04
#define PGPASN_uniformResourceIdentifier_GeneralNameFieldTag 0x80|0x20|0x06
#define PGPASN_iPAddress_GeneralNameFieldTag 0x80|0x20|0x07
#define PGPASN_registeredID_GeneralNameFieldTag 0x80|0x20|0x08

typedef struct {
    PGPASN_Name  issuer;
    PGPASN_CertificateSerialNumber  serialNumber;
} PGPASN_IssuerAndSerialNumber;
#define PGPASN_ID_IssuerAndSerialNumber PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_Version *version;
    PGPASN_AlgorithmIdentifier  signature;
    PGPASN_Name  issuer;
    PGPASN_Time  thisUpdate;
    PGPASN_Time *nextUpdate;
    PGPASN_revokedCertificates_SEQ_OF *revokedCertificates;
    PGPASN_Extensions *crlExtensions;
} PGPASN_TBSCertList;
#define PGPASN_ID_TBSCertList PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_Version *version;
    PGPASN_CertificateSerialNumber  serialNumber;
    PGPASN_AlgorithmIdentifier  signature;
    PGPASN_Name  issuer;
    PGPASN_Validity  validity;
    PGPASN_Name  subject;
    PGPASN_SubjectPublicKeyInfo  subjectPublicKeyInfo;
    PGPASN_UniqueIdentifier *issuerUniqueID;
    PGPASN_UniqueIdentifier *subjectUniqueID;
    PGPASN_Extensions *extensions;
} PGPASN_TBSCertificate;
#define PGPASN_ID_TBSCertificate PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_TBSCertificate  tbsCertificate;
    PGPASN_AlgorithmIdentifier  signatureAlgorithm;
    PGPASN_BIT_STRING  signature;
} PGPASN_Certificate;
#define PGPASN_ID_Certificate PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_TBSCertList  tbsCertList;
    PGPASN_AlgorithmIdentifier  signatureAlgorithm;
    PGPASN_BIT_STRING  signature;
} PGPASN_CertificateRevocationList;
#define PGPASN_ID_CertificateRevocationList PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_CertificationRequestInfo  certificationRequestInfo;
    PGPASN_SignatureAlgorithmIdentifier  signatureAlgorithm;
    PGPASN_Signature  signature;
} PGPASN_CertificationRequest;
#define PGPASN_ID_CertificationRequest PGPASN_ID_SEQUENCE

typedef struct {
    long  n;          /* number of elements */
    PGPASN_GeneralName *elt[ PGPASN_MAX_GeneralNames ];
} PGPASN_GeneralNames;
#define PGPASN_ID_GeneralNames PGPASN_ID_SEQUENCE_OF

typedef struct {
    PGPASN_Version  version;
    PGPASN_IssuerAndSerialNumber  issuerAndSerialNumber;
    PGPASN_DigestAlgorithmIdentifier  digestAlgorithm;
    PGPASN_Attributes *authenticatedAttributes;
    PGPASN_DigestEncryptionAlgorithmIdentifier  digestEncryptionAlgorithm;
    PGPASN_EncryptedDigest  encryptedDigest;
    PGPASN_Attributes *unauthenticatedAttributes;
} PGPASN_SignerInfo;
#define PGPASN_ID_SignerInfo PGPASN_ID_SEQUENCE

typedef struct {
    long  n;          /* number of elements */
    PGPASN_CertificateRevocationList *elt[ PGPASN_MAX_CertificateRevocationLists ];
} PGPASN_CertificateRevocationLists;
#define PGPASN_ID_CertificateRevocationLists PGPASN_ID_SET_OF

typedef struct {
    long  n;          /* number of elements */
    PGPASN_Certificate *elt[ PGPASN_MAX_Certificates ];
} PGPASN_Certificates;
#define PGPASN_ID_Certificates PGPASN_ID_SET_OF

typedef struct {
    unsigned char CHOICE_field_type;
    void *data;
} PGPASN_DistributionPointName;
#define PGPASN_ID_DistributionPointName PGPASN_ID_CHOICE
/* tags for fields defined for DistributionPointName */
#define PGPASN_fullName_DistributionPointNameFieldTag 0x80|0x00
#define PGPASN_nameRelativeToCRLIssuer_DistributionPointNameFieldTag 0x80|0x01

typedef struct {
    long  n;          /* number of elements */
    PGPASN_SignerInfo *elt[ PGPASN_MAX_SignerInfos ];
} PGPASN_SignerInfos;
#define PGPASN_ID_SignerInfos PGPASN_ID_SET_OF

typedef struct {
    PGPASN_DistributionPointName *distributionPoint;
    PGPASN_ReasonFlags *reasons;
    PGPASN_GeneralNames *cRLIssuer;
} PGPASN_DistributionPoint;
#define PGPASN_ID_DistributionPoint PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_DistributionPointName *distributionPoint;
    PGPASN_BOOLEAN *onlyContainsUserCerts;
    PGPASN_BOOLEAN *onlyContainsCACerts;
    PGPASN_ReasonFlags *onlySomeReasons;
    PGPASN_BOOLEAN *indirectCRL;
} PGPASN_IssuingDistributionPoint;
#define PGPASN_ID_IssuingDistributionPoint PGPASN_ID_SEQUENCE

typedef struct {
    PGPASN_Version  version;
    PGPASN_DigestAlgorithmIdentifiers  digestAlgorithms;
    PGPASN_ContentInfo  contentInfo;
    PGPASN_Certificates *certificates;
    PGPASN_CertificateRevocationLists *crls;
    PGPASN_SignerInfos  signerInfos;
} PGPASN_SignedData;
#define PGPASN_ID_SignedData PGPASN_ID_SEQUENCE

typedef struct {
    long  n;          /* number of elements */
    PGPASN_DistributionPoint *elt[ PGPASN_MAX_CRLDistPointsSyntax ];
} PGPASN_CRLDistPointsSyntax;
#define PGPASN_ID_CRLDistPointsSyntax PGPASN_ID_SEQUENCE_OF

#endif /* pgpX509Cert_STRUCT_H_ */
