@Override public Object getDecodedObject(BerInputStream in) { return new Extensions((List<Extension>) in.content); }
/** * Returns the value of Issuer Alternative Name Extension (OID = 2.5.29.18). * The ASN.1 definition for Issuer Alternative Name is: * * <pre> * id-ce-issuerAltName OBJECT IDENTIFIER ::= { id-ce 18 } * * IssuerAltName ::= GeneralNames * </pre> * (as specified in RFC 3280) * * @return Returns the collection of pairs: * (Integer (tag), Object (name value)) if extension presents, and * null if does not. */ public Collection<List<?>> valueOfIssuerAlternativeName() throws IOException { return decodeGeneralNames(getExtensionByOID("2.5.29.18")); }
public void dumpValue(StringBuilder sb) { sb.append("X.509 CRL v").append(version); sb.append("\nSignature Algorithm: ["); signature.dumpValue(sb); sb.append(']'); sb.append("\nIssuer: ").append(issuer.getName(X500Principal.RFC2253)); sb.append("\n\nThis Update: ").append(thisUpdate); sb.append("\nNext Update: ").append(nextUpdate).append('\n'); if (revokedCertificates != null) { sb.append("\nRevoked Certificates: ").append(revokedCertificates.size()).append(" ["); int number = 1; for (RevokedCertificate revokedCertificate : revokedCertificates) { sb.append("\n [").append(number++).append(']'); revokedCertificate.dumpValue(sb, " "); sb.append('\n'); } sb.append("]\n"); } if (crlExtensions != null) { sb.append("\nCRL Extensions: ").append(crlExtensions.size()).append(" ["); crlExtensions.dumpValue(sb, " "); sb.append("]\n"); } }
/** * @see java.security.cert.X509Extension#getCriticalExtensionOIDs() * method documentation for more info */ public Set getCriticalExtensionOIDs() { if (extensions == null) { return null; } return extensions.getCriticalExtensions(); }
/** * Returns the list of critical extensions. */ public Set<String> getCriticalExtensions() { Set<String> resultCritical = critical; if (resultCritical == null) { makeOidsLists(); resultCritical = critical; } return resultCritical; }
@Override public boolean hasUnsupportedCriticalExtension() { if (extensions == null) { return false; } // retrieve the info from the cached extensions object return extensions.hasUnsupportedCritical(); }
public boolean equals(Object rc) { if (!(rc instanceof RevokedCertificate)) { return false; } RevokedCertificate rcert = (RevokedCertificate) rc; return userCertificate.equals(rcert.userCertificate) && ((revocationDate.getTime() / 1000) == (rcert.revocationDate.getTime() / 1000)) && ((crlEntryExtensions == null) ? rcert.crlEntryExtensions == null : crlEntryExtensions.equals(rcert.crlEntryExtensions)); }
@Override public Set<String> getNonCriticalExtensionOIDs() { if (extensions == null) { return null; } // retrieve the info from the cached extensions object return extensions.getNonCriticalExtensions(); }
@Override public byte[] getExtensionValue(String oid) { if (extensions == null) { return null; } // retrieve the info from the cached extensions object Extension ext = extensions.getExtensionByOID(oid); return (ext == null) ? null : ext.getRawExtnValue(); }
public void dumpValue(StringBuilder sb, String prefix) { sb.append(prefix).append("Certificate Serial Number: ").append(userCertificate).append('\n'); sb.append(prefix).append("Revocation Date: ").append(revocationDate); if (crlEntryExtensions != null) { sb.append('\n').append(prefix).append("CRL Entry Extensions: ["); crlEntryExtensions.dumpValue(sb, prefix + " "); sb.append(prefix).append(']'); } }
public int hashCode() { return userCertificate.hashCode() * 37 + (int)revocationDate.getTime() / 1000 + (crlEntryExtensions == null ? 0 : crlEntryExtensions.hashCode()); }
/** * @see java.security.cert.X509Extension#getCriticalExtensionOIDs() * method documentation for more info */ public Set getCriticalExtensionOIDs() { if (extensions == null) { return null; } return extensions.getCriticalExtensions(); }
/** * Returns the list of critical extensions. */ public Set<String> getNonCriticalExtensions() { Set<String> resultNoncritical = noncritical; if (resultNoncritical == null) { makeOidsLists(); resultNoncritical = noncritical; } return resultNoncritical; }
/** * @see java.security.cert.X509Extension#hasUnsupportedCriticalExtension() * method documentation for more info */ public boolean hasUnsupportedCriticalExtension() { if (extensions == null) { return false; } return extensions.hasUnsupportedCritical(); } }
@Override public boolean equals(Object other) { if (!(other instanceof TBSCertList)) { return false; } TBSCertList that = (TBSCertList) other; return version == that.version && signature.equals(that.signature) && Arrays.equals(issuer.getEncoded(), that.issuer.getEncoded()) && thisUpdate.getTime() / 1000 == that.thisUpdate.getTime() / 1000 && (nextUpdate == null ? that.nextUpdate == null : nextUpdate.getTime() / 1000 == that.nextUpdate.getTime() / 1000) && ((revokedCertificates == null || that.revokedCertificates == null) && revokedCertificates == that.revokedCertificates || revokedCertificates.equals(that.revokedCertificates)) && (crlExtensions == null ? that.crlExtensions == null : crlExtensions.equals(that.crlExtensions)); }
/** * @see java.security.cert.X509Extension#getNonCriticalExtensionOIDs() * method documentation for more info */ public Set getNonCriticalExtensionOIDs() { if (extensions == null) { return null; } return extensions.getNonCriticalExtensions(); }
/** * @see java.security.cert.X509Extension#getExtensionValue(String) * method documentation for more info */ public byte[] getExtensionValue(String oid) { if (extensions == null) { return null; } Extension ext = extensions.getExtensionByOID(oid); return (ext == null) ? null : ext.getRawExtnValue(); }
sb.append("\n\n Extensions: "); sb.append("[\n"); extensions.dumpValue(sb, " "); sb.append(" ]");
public int hashCode() { return userCertificate.hashCode() * 37 + (int)revocationDate.getTime() / 1000 + (crlEntryExtensions == null ? 0 : crlEntryExtensions.hashCode()); }
/** * Returns the value of Subject Alternative Name (OID = 2.5.29.17). * The ASN.1 definition for Subject Alternative Name is: * * <pre> * id-ce-subjectAltName OBJECT IDENTIFIER ::= { id-ce 17 } * * SubjectAltName ::= GeneralNames * </pre> * (as specified in RFC 3280) * * @return Returns the collection of pairs: * (Integer (tag), Object (name value)) if extension presents, and * null if does not. */ public Collection<List<?>> valueOfSubjectAlternativeName() throws IOException { return decodeGeneralNames(getExtensionByOID("2.5.29.17")); }