Package org.bouncycastle.asn1.eac
Class CertificateBody
- java.lang.Object
-
- org.bouncycastle.asn1.ASN1Object
-
- org.bouncycastle.asn1.eac.CertificateBody
-
- All Implemented Interfaces:
ASN1Encodable,Encodable
public class CertificateBody extends ASN1Object
an Iso7816CertificateBody structure.CertificateBody ::= SEQUENCE { // version of the certificate format. Must be 0 (version 1) CertificateProfileIdentifer ASN1ApplicationSpecific, //uniquely identifies the issuinng CA's signature key pair // contains the iso3166-1 alpha2 encoded country code, the // name of issuer and the sequence number of the key pair. CertificationAuthorityReference ASN1ApplicationSpecific, // stores the encoded public key PublicKey Iso7816PublicKey, //associates the public key contained in the certificate with a unique name // contains the iso3166-1 alpha2 encoded country code, the // name of the holder and the sequence number of the key pair. certificateHolderReference ASN1ApplicationSpecific, // Encodes the role of the holder (i.e. CVCA, DV, IS) and assigns read/write // access rights to data groups storing sensitive data certificateHolderAuthorization Iso7816CertificateHolderAuthorization, // the date of the certificate generation CertificateEffectiveDate ASN1ApplicationSpecific, // the date after wich the certificate expires certificateExpirationDate ASN1ApplicationSpecific }
-
-
Field Summary
Fields Modifier and Type Field Description static intprofileTypestatic intrequestType
-
Constructor Summary
Constructors Constructor Description CertificateBody(ASN1ApplicationSpecific certificateProfileIdentifier, CertificationAuthorityReference certificationAuthorityReference, PublicKeyDataObject publicKey, CertificateHolderReference certificateHolderReference, CertificateHolderAuthorization certificateHolderAuthorization, PackedDate certificateEffectiveDate, PackedDate certificateExpirationDate)builds an Iso7816CertificateBody by settings each parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PackedDategetCertificateEffectiveDate()PackedDategetCertificateExpirationDate()CertificateHolderAuthorizationgetCertificateHolderAuthorization()the Iso7816CertificateHolderAuthorization encodes the role of the holder (i.e.CertificateHolderReferencegetCertificateHolderReference()certificateHolderReference : associates the public key contained in the certificate with a unique nameASN1ApplicationSpecificgetCertificateProfileIdentifier()CertificateProfileIdentifier : version of the certificate format.intgetCertificateType()gives the type of the certificate (value should be profileType or requestType if all data are set).CertificationAuthorityReferencegetCertificationAuthorityReference()get the certificationAuthorityReference certificationAuthorityReference : uniquely identifies the issuinng CA's signature key pairstatic CertificateBodygetInstance(java.lang.Object obj)Gives an instance of Iso7816CertificateBody taken from Object objPublicKeyDataObjectgetPublicKey()ASN1PrimitivetoASN1Primitive()create a "request" or "profile" type Iso7816CertificateBody according to the variables sets.-
Methods inherited from class org.bouncycastle.asn1.ASN1Object
encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode
-
-
-
-
Field Detail
-
profileType
public static final int profileType
- See Also:
- Constant Field Values
-
requestType
public static final int requestType
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CertificateBody
public CertificateBody(ASN1ApplicationSpecific certificateProfileIdentifier, CertificationAuthorityReference certificationAuthorityReference, PublicKeyDataObject publicKey, CertificateHolderReference certificateHolderReference, CertificateHolderAuthorization certificateHolderAuthorization, PackedDate certificateEffectiveDate, PackedDate certificateExpirationDate)
builds an Iso7816CertificateBody by settings each parameters.- Parameters:
certificateProfileIdentifier-certificationAuthorityReference-publicKey-certificateHolderReference-certificateHolderAuthorization-certificateEffectiveDate-certificateExpirationDate-
-
-
Method Detail
-
toASN1Primitive
public ASN1Primitive toASN1Primitive()
create a "request" or "profile" type Iso7816CertificateBody according to the variables sets.- Specified by:
toASN1Primitivein interfaceASN1Encodable- Specified by:
toASN1Primitivein classASN1Object- Returns:
- return the ASN1Primitive representing the "request" or "profile" type certificate body.
-
getCertificateType
public int getCertificateType()
gives the type of the certificate (value should be profileType or requestType if all data are set).- Returns:
- the int representing the data already set.
-
getInstance
public static CertificateBody getInstance(java.lang.Object obj) throws java.io.IOException
Gives an instance of Iso7816CertificateBody taken from Object obj- Parameters:
obj- is the Object to extract the certificate body from.- Returns:
- the Iso7816CertificateBody taken from Object obj.
- Throws:
java.io.IOException- if object is not valid.
-
getCertificateEffectiveDate
public PackedDate getCertificateEffectiveDate()
- Returns:
- the date of the certificate generation
-
getCertificateExpirationDate
public PackedDate getCertificateExpirationDate() throws java.io.IOException
- Returns:
- the date after wich the certificate expires
- Throws:
java.io.IOException
-
getCertificateHolderAuthorization
public CertificateHolderAuthorization getCertificateHolderAuthorization() throws java.io.IOException
the Iso7816CertificateHolderAuthorization encodes the role of the holder (i.e. CVCA, DV, IS) and assigns read/write access rights to data groups storing sensitive data. This functions returns the Certificate Holder Authorization- Returns:
- the Iso7816CertificateHolderAuthorization
- Throws:
java.io.IOException
-
getCertificateHolderReference
public CertificateHolderReference getCertificateHolderReference()
certificateHolderReference : associates the public key contained in the certificate with a unique name- Returns:
- the certificateHolderReference.
-
getCertificateProfileIdentifier
public ASN1ApplicationSpecific getCertificateProfileIdentifier()
CertificateProfileIdentifier : version of the certificate format. Must be 0 (version 1)- Returns:
- the CertificateProfileIdentifier
-
getCertificationAuthorityReference
public CertificationAuthorityReference getCertificationAuthorityReference() throws java.io.IOException
get the certificationAuthorityReference certificationAuthorityReference : uniquely identifies the issuinng CA's signature key pair- Returns:
- the certificationAuthorityReference
- Throws:
java.io.IOException
-
getPublicKey
public PublicKeyDataObject getPublicKey()
- Returns:
- the PublicKey
-
-