java.security.cert.X509Certificate.getExtensionValue()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(196)

本文整理了Java中java.security.cert.X509Certificate.getExtensionValue()方法的一些代码示例,展示了X509Certificate.getExtensionValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。X509Certificate.getExtensionValue()方法的具体详情如下:
包路径:java.security.cert.X509Certificate
类名称:X509Certificate
方法名:getExtensionValue

X509Certificate.getExtensionValue介绍

暂无

代码示例

代码示例来源:origin: Meituan-Dianping/walle

@Override
public byte[] getExtensionValue(String oid) {
  return mDelegate.getExtensionValue(oid);
}

代码示例来源:origin: floragunncom/search-guard

@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;
}

代码示例来源:origin: redisson/redisson

@Override
public byte[] getExtensionValue(String oid) {
  return unwrap().getExtensionValue(oid);
}

代码示例来源:origin: wildfly/wildfly

@Override
public byte[] getExtensionValue(String oid) {
  return unwrap().getExtensionValue(oid);
}

代码示例来源:origin: robovm/robovm

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;
  }
}

代码示例来源:origin: robovm/robovm

/**
 * 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;
  }
}

代码示例来源:origin: io.netty/netty-handler

@Override
public byte[] getExtensionValue(String oid) {
  return unwrap().getExtensionValue(oid);
}

代码示例来源:origin: hyperledger/fabric-sdk-java

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);
  }
}

代码示例来源:origin: apache/pdfbox

byte[] authorityExtensionValue = certificate.getExtensionValue(Extension.authorityInfoAccess.getId());
if (authorityExtensionValue != null)
byte[] crlExtensionValue = certificate.getExtensionValue(Extension.cRLDistributionPoints.getId());
if (crlExtensionValue != null)

代码示例来源:origin: apache/pdfbox

if (ocspResponderCertificate.getExtensionValue(OCSPObjectIdentifiers.id_pkix_ocsp_nocheck.getId()) != null)

代码示例来源:origin: apache/pdfbox

byte[] authorityExtensionValue = cert.getExtensionValue(Extension.authorityInfoAccess.getId());
if (authorityExtensionValue != null)

代码示例来源:origin: hyperledger/fabric-sdk-java

byte[] extensionValue = certificate.getExtensionValue(Extension.authorityKeyIdentifier.getId());
ASN1OctetString akiOc = ASN1OctetString.getInstance(extensionValue);
String aki = DatatypeConverter.printHexBinary(AuthorityKeyIdentifier.getInstance(akiOc.getOctets()).getKeyIdentifier());

代码示例来源:origin: apache/pdfbox

throws IOException
byte[] crldpExt = cert.getExtensionValue(Extension.cRLDistributionPoints.getId());
if (crldpExt == null)

代码示例来源:origin: apache/pdfbox

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)

代码示例来源:origin: MobiVM/robovm

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;
  }
}

代码示例来源:origin: ibinti/bugvm

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;
  }
}

代码示例来源:origin: ibinti/bugvm

public static Collection getIssuerAlternativeNames(X509Certificate cert)
    throws CertificateParsingException
{
  byte[] extVal = cert.getExtensionValue(X509Extension.issuerAlternativeName.getId());
  return getAlternativeNames(extVal);
}

代码示例来源:origin: ibinti/bugvm

public static Collection getSubjectAlternativeNames(X509Certificate cert)
    throws CertificateParsingException
{        
  byte[] extVal = cert.getExtensionValue(X509Extension.subjectAlternativeName.getId());
  return getAlternativeNames(extVal);
}

代码示例来源:origin: kaikramer/keystore-explorer

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 "-";
  }
}

代码示例来源:origin: kaikramer/keystore-explorer

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 "-";
  }
}

相关文章

微信公众号

最新文章

更多