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

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

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

X509Certificate.getSignature介绍

[英]Returns the raw signature bits from the certificate.
[中]返回证书中的原始签名位。

代码示例

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

@Override
public byte[] getSignature() {
  return mDelegate.getSignature();
}

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

@Override
public byte[] getSignature() {
  return unwrap().getSignature();
}

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

@Override
public byte[] getSignature() {
  return unwrap().getSignature();
}

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

@Override
public byte[] getSignature() {
  return unwrap().getSignature();
}

代码示例来源:origin: org.eclipse.jetty/jetty-security

final String username = principal == null ? "clientcert" : principal.getName();
final char[] credential = B64Code.encode(cert.getSignature());

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

@Test
public void testCertificateConversionMethods() throws Exception {
  final X509Certificate in = caCertificate;
  final String pem = CertUtils.x509CertificateToPem(in);
  final X509Certificate out = CertUtils.pemToX509Certificate(pem);
  Assert.assertTrue(pem.startsWith("-----BEGIN CERTIFICATE-----\n"));
  Assert.assertTrue(pem.endsWith("-----END CERTIFICATE-----\n"));
  Assert.assertEquals(in.getSerialNumber(), out.getSerialNumber());
  Assert.assertArrayEquals(in.getSignature(), out.getSignature());
  Assert.assertEquals(in.getSigAlgName(), out.getSigAlgName());
  Assert.assertEquals(in.getPublicKey(), out.getPublicKey());
  Assert.assertEquals(in.getNotBefore(), out.getNotBefore());
  Assert.assertEquals(in.getNotAfter(), out.getNotAfter());
  Assert.assertEquals(in.getIssuerDN().toString(), out.getIssuerDN().toString());
}

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

@Override
/**
 * {@inheritDoc}
 */
public byte[] getSignature()
{
  return internalCert.getSignature();
}

代码示例来源:origin: mcxiaoke/ApkSigner

@Override
public byte[] getSignature() {
  return mDelegate.getSignature();
}

代码示例来源:origin: apache/activemq-artemis

@Override
public byte[] getSignature() {
  return unwrap().getSignature();
}

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

@Override
public byte[] getSignature() {
  return unwrap().getSignature();
}

代码示例来源:origin: com.couchbase.client/core-io

@Override
public byte[] getSignature() {
  return unwrap().getSignature();
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

@Override
public byte[] getSignature() {
  return unwrap().getSignature();
}

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

@Override
public byte[] getSignature() {
  return unwrap().getSignature();
}

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

@Override
public byte[] getSignature() {
  return unwrap().getSignature();
}

代码示例来源:origin: apache/activemq-artemis

@Override
public byte[] getSignature() {
  return unwrap().getSignature();
}

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

@Override
public byte[] getSignature() {
  return unwrap().getSignature();
}

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

@Override
public byte[] getSignature() {
  return unwrap().getSignature();
}

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

private static void writeX509Certificate(final ModelNode certificateModel, final X509Certificate certificate) throws CertificateEncodingException, NoSuchAlgorithmException {
  SimpleDateFormat sdf = new SimpleDateFormat(ISO_8601_FORMAT);
  certificateModel.get(ElytronDescriptionConstants.SUBJECT).set(certificate.getSubjectX500Principal().getName());
  certificateModel.get(ElytronDescriptionConstants.ISSUER).set(certificate.getIssuerX500Principal().getName());
  certificateModel.get(ElytronDescriptionConstants.NOT_BEFORE).set(sdf.format(certificate.getNotBefore()));
  certificateModel.get(ElytronDescriptionConstants.NOT_AFTER).set(sdf.format(certificate.getNotAfter()));
  certificateModel.get(ElytronDescriptionConstants.SERIAL_NUMBER).set(delimit(certificate.getSerialNumber().toString(16).toCharArray()));
  certificateModel.get(ElytronDescriptionConstants.SIGNATURE_ALGORITHM).set(certificate.getSigAlgName());
  certificateModel.get(ElytronDescriptionConstants.SIGNATURE).set(encodedHexString(certificate.getSignature()));
  certificateModel.get(ElytronDescriptionConstants.VERSION).set("v" + certificate.getVersion());
}

代码示例来源:origin: GluuFederation/oxAuth

public void checkForTrustedCertsInAttestation(List<X509Certificate> attestationCerts, List<X509Certificate> trustChainCertificates) {
  final List<String> trustedSignatures = trustChainCertificates.stream().map(cert -> base64Service.encodeToString(cert.getSignature()))
      .collect(Collectors.toList());
  List<String> duplicateSignatures = attestationCerts.stream().map(cert -> base64Service.encodeToString(cert.getSignature()))
      .filter(sig -> trustedSignatures.contains(sig)).collect(Collectors.toList());
  if (!duplicateSignatures.isEmpty()) {
    throw new Fido2RPRuntimeException("Root certificate in the attestation");
  }
}

代码示例来源:origin: arhs/sd-dss

private static void checkCertificateUniqueness(final X509Certificate certificateToAdd, final CertificateToken certToken) {
  final X509Certificate foundCertificate = certToken.getCertificate();
  final byte[] foundCertificateSignature = foundCertificate.getSignature();
  final byte[] certificateToAddSignature = certificateToAdd.getSignature();
  if (!Arrays.equals(foundCertificateSignature, certificateToAddSignature)) {
    LOG.warn("Found certificate: " + certToken.getIssuerX500Principal().toString() + "|" + certToken.getSerialNumber());
    LOG.warn("More than one certificate for the same issuer subject name and serial number! The standard is not met by the certificate issuer!");
  }
}

相关文章