/** * @return the date of the certificate generation */ public PackedDate getEffectiveDate() throws IOException { return certificateBody.getCertificateEffectiveDate(); }
/** * @return the date of the certificate generation */ public PackedDate getExpirationDate() throws IOException { return certificateBody.getCertificateExpirationDate(); }
/** * @return the Holder Reference Field of the certificate * @throws IOException */ public CertificateHolderReference getHolderReference() throws IOException { return certificateBody.getCertificateHolderReference(); }
/** * create a "request" or "profile" type Iso7816CertificateBody according to the variables sets. * * @return return the ASN1Primitive representing the "request" or "profile" type certificate body. */ public ASN1Primitive toASN1Primitive() { try { if (certificateType == profileType) { return profileToASN1Object(); } if (certificateType == requestType) { return requestToASN1Object(); } } catch (IOException e) { return null; } return null; }
/** * @return the Holder authorization and role (CVCA, DV, IS). */ public ASN1ObjectIdentifier getHolderAuthorization() throws IOException { CertificateHolderAuthorization cha = certificateBody.getCertificateHolderAuthorization(); return cha.getOid(); }
private void initCertBody(DERApplicationSpecific request) throws IOException { if (request.getApplicationTag() == EACTags.CARDHOLDER_CERTIFICATE) { ASN1Sequence seq = ASN1Sequence.getInstance(request.getObject(BERTags.SEQUENCE)); for (Enumeration en = seq.getObjects(); en.hasMoreElements();) { DERApplicationSpecific obj = DERApplicationSpecific.getInstance(en.nextElement()); switch (obj.getApplicationTag()) { case EACTags.CERTIFICATE_CONTENT_TEMPLATE: certificateBody = CertificateBody.getInstance(obj); valid |= bodyValid; break; case EACTags.STATIC_INTERNAL_AUTHENTIFICATION_ONE_STEP: innerSignature = obj.getContents(); valid |= signValid; break; default: throw new IOException("Invalid tag, not an CV Certificate Request element:" + obj.getApplicationTag()); } } } else { throw new IOException("not a CARDHOLDER_CERTIFICATE in request:" + request.getApplicationTag()); } }
/** * Return the public key data object carried in the request * @return the public key */ public PublicKeyDataObject getPublicKey() { return certificateBody.getPublicKey(); }
/** * Gives an instance of Iso7816CertificateBody taken from Object obj * * @param obj is the Object to extract the certificate body from. * @return the Iso7816CertificateBody taken from Object obj. * @throws IOException if object is not valid. */ public static CertificateBody getInstance(Object obj) throws IOException { if (obj instanceof CertificateBody) { return (CertificateBody)obj; } else if (obj != null) { return new CertificateBody(ASN1ApplicationSpecific.getInstance(obj)); } return null; }
/** * @return the Authority Reference field of the certificate * @throws IOException */ public CertificationAuthorityReference getAuthorityReference() throws IOException { return certificateBody.getCertificationAuthorityReference(); }
/** * @return the type of certificate (request or profile) * value is either Iso7816CertificateBody.profileType * or Iso7816CertificateBody.requestType. Any other value * is not valid. */ public int getCertificateType() { return this.certificateBody.getCertificateType(); }
/** * @return the bits corresponding to the role intented for the certificate * See Iso7816CertificateHolderAuthorization static int for values * @throws IOException */ public int getHolderAuthorizationRole() throws IOException { int rights = certificateBody.getCertificateHolderAuthorization().getAccessRights(); return rights & 0xC0; }
/** * create a "request" or "profile" type Iso7816CertificateBody according to the variables sets. * * @return return the ASN1Primitive representing the "request" or "profile" type certificate body. */ public ASN1Primitive toASN1Primitive() { try { if (certificateType == profileType) { return profileToASN1Object(); } if (certificateType == requestType) { return requestToASN1Object(); } } catch (IOException e) { return null; } return null; }
certificateBody = CertificateBody.getInstance(obj); valid |= bodyValid; break;
/** * Return the public key data object carried in the request * @return the public key */ public PublicKeyDataObject getPublicKey() { return certificateBody.getPublicKey(); }
/** * Gives an instance of Iso7816CertificateBody taken from Object obj * * @param obj is the Object to extract the certificate body from. * @return the Iso7816CertificateBody taken from Object obj. * @throws IOException if object is not valid. */ public static CertificateBody getInstance(Object obj) throws IOException { if (obj instanceof CertificateBody) { return (CertificateBody)obj; } else if (obj != null) { return new CertificateBody(DERApplicationSpecific.getInstance(obj)); } return null; }
/** * @return the Authority Reference field of the certificate * @throws IOException */ public CertificationAuthorityReference getAuthorityReference() throws IOException { return certificateBody.getCertificationAuthorityReference(); }
/** * @return the type of certificate (request or profile) * value is either Iso7816CertificateBody.profileType * or Iso7816CertificateBody.requestType. Any other value * is not valid. */ public int getCertificateType() { return this.certificateBody.getCertificateType(); }
/** * @return the Holder authorization and role (CVCA, DV, IS). */ public ASN1ObjectIdentifier getHolderAuthorization() throws IOException { CertificateHolderAuthorization cha = certificateBody.getCertificateHolderAuthorization(); return cha.getOid(); }
certificateBody = CertificateBody.getInstance(aSpe); valid |= bodyValid; break;
/** * @return the date of the certificate generation */ public PackedDate getEffectiveDate() throws IOException { return certificateBody.getCertificateEffectiveDate(); }