本文整理了Java中java.security.cert.X509Certificate.getType()
方法的一些代码示例,展示了X509Certificate.getType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。X509Certificate.getType()
方法的具体详情如下:
包路径:java.security.cert.X509Certificate
类名称:X509Certificate
方法名:getType
暂无
代码示例来源:origin: skylot/jadx
public String generateHeader() {
StringBuilder builder = new StringBuilder();
append(builder, NLS.str("certificate.cert_type"), x509cert.getType());
append(builder, NLS.str("certificate.serialSigVer"), ((Integer) x509cert.getVersion()).toString());
// serial number
append(builder, NLS.str("certificate.serialNumber"), "0x" + x509cert.getSerialNumber().toString(16));
// Get subject
Principal subjectDN = x509cert.getSubjectDN();
append(builder, NLS.str("certificate.cert_subject"), subjectDN.getName());
append(builder, NLS.str("certificate.serialValidFrom"), x509cert.getNotBefore().toString());
append(builder, NLS.str("certificate.serialValidUntil"), x509cert.getNotAfter().toString());
return builder.toString();
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public void checkClientTrusted(X509Certificate[] certs, String authType) {
StringBuilder buf = new StringBuilder();
buf.append("Trust manager handle client certificates [authType=");
buf.append(authType);
buf.append(", certificates=");
for (X509Certificate cert : certs) {
buf.append("{type=");
buf.append(cert.getType());
buf.append(", principalName=");
buf.append(cert.getSubjectX500Principal().getName());
buf.append('}');
}
buf.append(']');
if (scanCtx.getLogger().isDebugEnabled())
scanCtx.getLogger().debug(buf.toString());
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public void checkServerTrusted(X509Certificate[] certs, String authType) {
StringBuilder buf = new StringBuilder();
buf.append("Trust manager handle server certificates [authType=");
buf.append(authType);
buf.append(", certificates=");
for (X509Certificate cert : certs) {
buf.append("{type=");
buf.append(cert.getType());
buf.append(", principalName=");
buf.append(cert.getSubjectX500Principal().getName());
buf.append('}');
}
buf.append(']');
if (scanCtx.getLogger().isDebugEnabled())
scanCtx.getLogger().debug(buf.toString());
}
}
代码示例来源:origin: com.github.mcpat.gcf/gcf-standard
public String getType() {
return _cert.getType();
}
代码示例来源:origin: org.microemu/microemu-javase
public String getType() {
return cert.getType();
}
代码示例来源:origin: stackoverflow.com
InputStream inStream = null;
try {
inStream = new FileInputStream("<cert-file-name-with-path>");
CertificateFactory cf = CertificateFactory.getInstance("X.509");
X509Certificate cert = (X509Certificate)cf.generateCertificate(inStream);
System.out.println("##"+cert.getSigAlgName()+"##"+cert.getSigAlgOID()+"##"+cert.getType());
} finally {
if (inStream != null) {
inStream.close();
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
f.format(" Serial Nr %s%n", Hex.separated(bytes, ":"));
f.format(" Issuer %s%n", certificate.getIssuerDN());
f.format(" Type %s%n", certificate.getType());
try {
certificate.checkValidity();
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
f.format(" Serial Nr %s%n", Hex.separated(bytes, ":"));
f.format(" Issuer %s%n", certificate.getIssuerDN());
f.format(" Type %s%n", certificate.getType());
try {
certificate.checkValidity();
代码示例来源:origin: io.macgyver/macgyver-core
n.put("isDateValid", true);
n.put("version", cert.getVersion());
n.put("type", cert.getType());
代码示例来源:origin: droidefense/engine
signatureAlgorithm = c.getSigAlgName();
oid = c.getSigAlgOID();
type = c.getType();
publicKeyAlgorithm = c.getPublicKey().getAlgorithm();
startDate = c.getNotBefore();
代码示例来源:origin: eu.eu-emi.security/canl
cert.getIssuerX500Principal());
int version = cert.getVersion();
sb.append(cert.getType()).append(" v").append(version);
sb.append(" certificate").append(sep);
sb.append("Subject: ").append(subject).append(sep);
代码示例来源:origin: cdapio/cdap
@Test
public void testGetSSLKeyStore() throws Exception {
SConfiguration sConf = SConfiguration.create();
sConf.set(Constants.Security.SSL.KEYSTORE_PASSWORD, SSL_PASSWORD);
KeyStore ks = KeyStores.generatedCertKeyStore(sConf, SSL_PASSWORD);
Assert.assertEquals(KeyStores.SSL_KEYSTORE_TYPE, ks.getType());
Assert.assertEquals(KeyStores.CERT_ALIAS, ks.aliases().nextElement());
Assert.assertEquals(1, ks.size());
Assert.assertTrue(ks.getCertificate(KeyStores.CERT_ALIAS) instanceof X509Certificate);
X509Certificate cert = (X509Certificate) ks.getCertificate(KeyStores.CERT_ALIAS);
cert.checkValidity(); // throws an exception on failure
Assert.assertEquals(CERTIFICATE_TYPE, cert.getType());
Assert.assertEquals(KeyStores.SIGNATURE_ALGORITHM, cert.getSigAlgName());
Assert.assertEquals(KeyStores.DISTINGUISHED_NAME, cert.getIssuerDN().getName());
Assert.assertEquals(3, cert.getVersion());
}
代码示例来源:origin: onelogin/java-saml
/**
* Tests the loadCert method
*
* @throws IOException
* @throws URISyntaxException
* @throws CertificateException
*
* @see com.onelogin.saml2.util.Util#loadCert
*/
@Test
public void testLoadCertCert() throws URISyntaxException, IOException, CertificateException {
String cert = Util.getFileAsString("data/customPath/certs/sp.crt");
String certWithHeads = Util.formatCert(cert, true);
String certWithoutHeads = Util.formatCert(cert, false);
X509Certificate certObject1 = Util.loadCert(certWithHeads);
X509Certificate certObject2 = Util.loadCert(certWithoutHeads);
assertNotNull(certObject1);
assertNotNull(certObject2);
assertEquals(certObject1.getSigAlgName(), certObject2.getSigAlgName());
assertEquals("X.509", certObject1.getType());
assertEquals("X.509", certObject2.getType());
}
内容来源于网络,如有侵权,请联系作者删除!