@Override public byte[] getExtensionValue(String oid) { return mDelegate.getExtensionValue(oid); }
@Override public boolean isInterClusterRequest(TransportRequest request, X509Certificate[] localCerts, X509Certificate[] peerCerts, final String principal) { if (localCerts != null && localCerts.length > 0 && peerCerts != null && peerCerts.length > 0) { final byte[] localValue = localCerts[0].getExtensionValue(certOid); final byte[] peerValue = peerCerts[0].getExtensionValue(certOid); if (localValue != null && peerValue != null) { return Arrays.equals(localValue, peerValue); } } return false; }
@Override public byte[] getExtensionValue(String oid) { return unwrap().getExtensionValue(oid); }
@Override public byte[] getExtensionValue(String oid) { return unwrap().getExtensionValue(oid); }
private byte[] getExtensionValue(X509Certificate cert, String oid) { try { byte[] bytes = cert.getExtensionValue(oid); if (bytes == null) { return null; } return (byte[]) ASN1OctetString.getInstance().decode(bytes); } catch (IOException e) { return null; } }
/** * Returns the value of certificate extension */ private byte[] getExtensionValue(X509Certificate cert, String OID) { try { byte[] bytes = cert.getExtensionValue(OID); if (bytes == null) { return null; } return (byte[]) ASN1OctetString.getInstance().decode(bytes); } catch (IOException e) { return null; } }
@Override public byte[] getExtensionValue(String oid) { return unwrap().getExtensionValue(oid); }
private AuthorityKeyIdentifier getAKI() throws HFCACertificateException { if (x509Cert == null) { throw new HFCACertificateException("Certificate is null"); } byte[] fullExtValue = x509Cert.getExtensionValue(Extension.authorityKeyIdentifier.getId()); byte[] extValue = ASN1OctetString.getInstance(fullExtValue).getOctets(); return AuthorityKeyIdentifier.getInstance(extValue); } }
byte[] authorityExtensionValue = certificate.getExtensionValue(Extension.authorityInfoAccess.getId()); if (authorityExtensionValue != null) byte[] crlExtensionValue = certificate.getExtensionValue(Extension.cRLDistributionPoints.getId()); if (crlExtensionValue != null)
if (ocspResponderCertificate.getExtensionValue(OCSPObjectIdentifiers.id_pkix_ocsp_nocheck.getId()) != null)
byte[] authorityExtensionValue = cert.getExtensionValue(Extension.authorityInfoAccess.getId()); if (authorityExtensionValue != null)
byte[] extensionValue = certificate.getExtensionValue(Extension.authorityKeyIdentifier.getId()); ASN1OctetString akiOc = ASN1OctetString.getInstance(extensionValue); String aki = DatatypeConverter.printHexBinary(AuthorityKeyIdentifier.getInstance(akiOc.getOctets()).getKeyIdentifier());
throws IOException byte[] crldpExt = cert.getExtensionValue(Extension.cRLDistributionPoints.getId()); if (crldpExt == null)
private void updateVRI(CertSignatureInformation certInfo, COSDictionary vri) throws IOException if (certInfo.getCertificate().getExtensionValue(OCSPObjectIdentifiers.id_pkix_ocsp_nocheck.getId()) == null) if (cert.getExtensionValue(OCSPObjectIdentifiers.id_pkix_ocsp_nocheck.getId()) != null)
private byte[] getExtensionValue(X509Certificate cert, String oid) { try { byte[] bytes = cert.getExtensionValue(oid); if (bytes == null) { return null; } return (byte[]) ASN1OctetString.getInstance().decode(bytes); } catch (IOException e) { return null; } }
private byte[] getExtensionValue(X509Certificate cert, String oid) { try { byte[] bytes = cert.getExtensionValue(oid); if (bytes == null) { return null; } return (byte[]) ASN1OctetString.getInstance().decode(bytes); } catch (IOException e) { return null; } }
public static Collection getIssuerAlternativeNames(X509Certificate cert) throws CertificateParsingException { byte[] extVal = cert.getExtensionValue(X509Extension.issuerAlternativeName.getId()); return getAlternativeNames(extVal); }
public static Collection getSubjectAlternativeNames(X509Certificate cert) throws CertificateParsingException { byte[] extVal = cert.getExtensionValue(X509Extension.subjectAlternativeName.getId()); return getAlternativeNames(extVal); }
private String getCertificateSKI(String alias, KeyStore keyStore) throws CryptoException, KeyStoreException { X509Certificate x509Cert = getCertificate(alias, keyStore); try { byte[] skiValue = x509Cert.getExtensionValue(Extension.subjectKeyIdentifier.getId()); byte[] octets = DEROctetString.getInstance(skiValue).getOctets(); byte[] skiBytes = SubjectKeyIdentifier.getInstance(octets).getKeyIdentifier(); return HexUtil.getHexString(skiBytes); } catch (Exception e) { return "-"; } }
private String getCertificateAKI(String alias, KeyStore keyStore) throws CryptoException, KeyStoreException { X509Certificate x509Cert = getCertificate(alias, keyStore); try { byte[] akiValue = x509Cert.getExtensionValue(Extension.authorityKeyIdentifier.getId()); byte[] octets = DEROctetString.getInstance(akiValue).getOctets(); byte[] akiBytes = AuthorityKeyIdentifier.getInstance(octets).getKeyIdentifier(); return HexUtil.getHexString(akiBytes); } catch (Exception e) { return "-"; } }