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

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

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

X509Certificate.getSigAlgOID介绍

[英]Returns the OID of the signature algorithm from the certificate.
[中]

代码示例

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

@Override
public String getSigAlgOID() {
  return mDelegate.getSigAlgOID();
}

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

public String getSigAlgOID() {
  return cert.getSigAlgOID();
}

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

@Override
public String getSigAlgOID() {
  return unwrap().getSigAlgOID();
}

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

static byte[] getChannelBindingData(X509Certificate serverCert) throws NoSuchAlgorithmException, CertificateEncodingException {
    if (serverCert == null) {
      return null;
    }
    final String digestAlgorithm = TLSServerEndPointChannelBinding.getDigestAlgorithm(serverCert.getSigAlgOID());
    if (digestAlgorithm == null) {
      return null;
    }
    return MessageDigest.getInstance(digestAlgorithm).digest(serverCert.getEncoded());
  }
}

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

@Override
public String getSigAlgOID() {
  return unwrap().getSigAlgOID();
}

代码示例来源:origin: skylot/jadx

public String generateSignature() {
  StringBuilder builder = new StringBuilder();
  append(builder, NLS.str("certificate.serialSigType"), x509cert.getSigAlgName());
  append(builder, NLS.str("certificate.serialSigOID"), x509cert.getSigAlgOID());
  return builder.toString();
}

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

@Override
public String getSigAlgOID() {
  return unwrap().getSigAlgOID();
}

代码示例来源:origin: hsiafan/apk-parser

public static CertificateMeta from(X509Certificate certificate) throws CertificateEncodingException {
  byte[] bytes = certificate.getEncoded();
  String certMd5 = md5Digest(bytes);
  String publicKeyString = byteToHexString(bytes);
  String certBase64Md5 = md5Digest(publicKeyString);
  return new CertificateMeta(
      certificate.getSigAlgName().toUpperCase(),
      certificate.getSigAlgOID(),
      certificate.getNotBefore(),
      certificate.getNotAfter(),
      bytes, certBase64Md5, certMd5);
}

代码示例来源:origin: org.nhind/agent

@Override
/**
 * {@inheritDoc}
 */
public String getSigAlgOID()  
{
  return internalCert.getSigAlgOID();
}

代码示例来源:origin: org.conscrypt/conscrypt-openjdk

private int compareSignatureAlgorithm(X509Certificate lhs, X509Certificate rhs) {
    Integer lhsPriority = ALGORITHM_OID_PRIORITY_MAP.get(lhs.getSigAlgOID());
    Integer rhsPriority = ALGORITHM_OID_PRIORITY_MAP.get(rhs.getSigAlgOID());
    if (lhsPriority == null) {
      lhsPriority = PRIORITY_UNKNOWN;
    }
    if (rhsPriority == null) {
      rhsPriority = PRIORITY_UNKNOWN;
    }
    return rhsPriority - lhsPriority;
  }
}

代码示例来源:origin: org.conscrypt/conscrypt-openjdk-uber

private int compareSignatureAlgorithm(X509Certificate lhs, X509Certificate rhs) {
    Integer lhsPriority = ALGORITHM_OID_PRIORITY_MAP.get(lhs.getSigAlgOID());
    Integer rhsPriority = ALGORITHM_OID_PRIORITY_MAP.get(rhs.getSigAlgOID());
    if (lhsPriority == null) {
      lhsPriority = PRIORITY_UNKNOWN;
    }
    if (rhsPriority == null) {
      rhsPriority = PRIORITY_UNKNOWN;
    }
    return rhsPriority - lhsPriority;
  }
}

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

private static final void checkNotMD5(X509Certificate cert) throws CertificateException {
    String oid = cert.getSigAlgOID();
    for (String blacklisted : OID_BLACKLIST) {
      if (oid.equals(blacklisted)) {
        throw new CertificateException("Signature uses an insecure hash function");
      }
    }
  }
}

代码示例来源:origin: com.bugvm/bugvm-rt

private static final void checkNotMD5(X509Certificate cert) throws CertificateException {
    String oid = cert.getSigAlgOID();
    for (String blacklisted : OID_BLACKLIST) {
      if (oid.equals(blacklisted)) {
        throw new CertificateException("Signature uses an insecure hash function");
      }
    }
  }
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

static byte[] getChannelBindingData(X509Certificate serverCert) throws NoSuchAlgorithmException, CertificateEncodingException {
    if (serverCert == null) {
      return null;
    }
    final String digestAlgorithm = TLSServerEndPointChannelBinding.getDigestAlgorithm(serverCert.getSigAlgOID());
    if (digestAlgorithm == null) {
      return null;
    }
    return MessageDigest.getInstance(digestAlgorithm).digest(serverCert.getEncoded());
  }
}

代码示例来源:origin: com.aliyun.openservices/ons-client

@Override
public String getSigAlgOID() {
  return unwrap().getSigAlgOID();
}

代码示例来源:origin: org.apache.hbase.thirdparty/hbase-shaded-netty

@Override
public String getSigAlgOID() {
  return unwrap().getSigAlgOID();
}

代码示例来源:origin: org.apache.ratis/ratis-proto-shaded

@Override
public String getSigAlgOID() {
  return unwrap().getSigAlgOID();
}

代码示例来源:origin: com.datastax.oss/java-driver-core-shaded

@Override
public String getSigAlgOID() {
  return unwrap().getSigAlgOID();
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron

static byte[] getChannelBindingData(X509Certificate serverCert) throws NoSuchAlgorithmException, CertificateEncodingException {
    if (serverCert == null) {
      return null;
    }
    final String digestAlgorithm = TLSServerEndPointChannelBinding.getDigestAlgorithm(serverCert.getSigAlgOID());
    if (digestAlgorithm == null) {
      return null;
    }
    return MessageDigest.getInstance(digestAlgorithm).digest(serverCert.getEncoded());
  }
}

代码示例来源:origin: net.dongliu/apk-parser

public static CertificateMeta from(X509Certificate certificate) throws CertificateEncodingException {
  byte[] bytes = certificate.getEncoded();
  String certMd5 = md5Digest(bytes);
  String publicKeyString = byteToHexString(bytes);
  String certBase64Md5 = md5Digest(publicKeyString);
  return new CertificateMeta(
      certificate.getSigAlgName().toUpperCase(),
      certificate.getSigAlgOID(),
      certificate.getNotBefore(),
      certificate.getNotAfter(),
      bytes, certBase64Md5, certMd5);
}

相关文章