• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MiscObjectIdentifiers类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.bouncycastle.asn1.misc.MiscObjectIdentifiers的典型用法代码示例。如果您正苦于以下问题:Java MiscObjectIdentifiers类的具体用法?Java MiscObjectIdentifiers怎么用?Java MiscObjectIdentifiers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MiscObjectIdentifiers类属于org.bouncycastle.asn1.misc包,在下文中一共展示了MiscObjectIdentifiers类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: configure

import org.bouncycastle.asn1.misc.MiscObjectIdentifiers; //导入依赖的package包/类
public void configure(ConfigurableProvider provider)
{
    provider.addAlgorithm("AlgorithmParameterGenerator.IDEA", PREFIX + "$AlgParamGen");
    provider.addAlgorithm("AlgorithmParameterGenerator.1.3.6.1.4.1.188.7.1.1.2", PREFIX + "$AlgParamGen");
    provider.addAlgorithm("AlgorithmParameters.IDEA", PREFIX + "$AlgParams");
    provider.addAlgorithm("AlgorithmParameters.1.3.6.1.4.1.188.7.1.1.2", PREFIX + "$AlgParams");
    provider.addAlgorithm("Alg.Alias.AlgorithmParameters.PBEWITHSHAANDIDEA", "PKCS12PBE");
    provider.addAlgorithm("Alg.Alias.AlgorithmParameters.PBEWITHSHAANDIDEA-CBC", "PKCS12PBE");
    provider.addAlgorithm("Cipher.IDEA", PREFIX + "$ECB");
    provider.addAlgorithm("Cipher", MiscObjectIdentifiers.as_sys_sec_alg_ideaCBC, PREFIX + "$CBC");
    provider.addAlgorithm("Cipher.PBEWITHSHAANDIDEA-CBC", PREFIX + "$PBEWithSHAAndIDEA");
    provider.addAlgorithm("KeyGenerator.IDEA", PREFIX + "$KeyGen");
    provider.addAlgorithm("KeyGenerator",  MiscObjectIdentifiers.as_sys_sec_alg_ideaCBC, PREFIX + "$KeyGen");
    provider.addAlgorithm("SecretKeyFactory.PBEWITHSHAANDIDEA-CBC", PREFIX + "$PBEWithSHAAndIDEAKeyGen");
    provider.addAlgorithm("Mac.IDEAMAC", PREFIX + "$Mac");
    provider.addAlgorithm("Alg.Alias.Mac.IDEA", "IDEAMAC");
    provider.addAlgorithm("Mac.IDEAMAC/CFB8", PREFIX + "$CFB8Mac");
    provider.addAlgorithm("Alg.Alias.Mac.IDEA/CFB8", "IDEAMAC/CFB8");
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:20,代码来源:IDEA.java


示例2: generateDummySSLClientCertificate

import org.bouncycastle.asn1.misc.MiscObjectIdentifiers; //导入依赖的package包/类
private void generateDummySSLClientCertificate(KeyStore ks)
	throws Exception
{
	LOG.info("Generating a Dummy SSL client certificate ...");
	KeyPair pair = CertificateUtilities.generateRSAKeyPair(getCryptoStrength());
	String DN = "CN=SSL dummy client cert, O=Dummy org., C=FR";
	X509V3CertificateGenerator v3CertGen = CertificateUtilities.initCertificateGenerator(pair, DN, DN, true,
			CertificateUtilities.DEFAULT_VALIDITY_PERIOD);

	v3CertGen.addExtension(X509Extensions.BasicConstraints, true, new BasicConstraints(false));

	v3CertGen.addExtension(MiscObjectIdentifiers.netscapeCertType, false, new NetscapeCertType(NetscapeCertType.sslClient));

	v3CertGen.addExtension(X509Extensions.ExtendedKeyUsage, false, new ExtendedKeyUsage(KeyPurposeId.id_kp_clientAuth));

	X509Certificate cert = v3CertGen.generate(pair.getPrivate());
	ks.setKeyEntry(DUMMY_SSL_CLIENT_ALIAS, pair.getPrivate(), KEYSTORE_PASSWORD, new Certificate[] {cert});
}
 
开发者ID:edeoliveira,项目名称:Mailster,代码行数:19,代码来源:MailsterKeyStoreFactory.java


示例3: configure

import org.bouncycastle.asn1.misc.MiscObjectIdentifiers; //导入依赖的package包/类
public void configure(ConfigurableProvider provider)
{

    provider.addAlgorithm("Mac.BLOWFISHCMAC", PREFIX + "$CMAC");
    provider.addAlgorithm("Cipher.BLOWFISH", PREFIX + "$ECB");
    provider.addAlgorithm("Cipher", MiscObjectIdentifiers.cryptlib_algorithm_blowfish_CBC, PREFIX + "$CBC");
    provider.addAlgorithm("KeyGenerator.BLOWFISH", PREFIX + "$KeyGen");
    provider.addAlgorithm("Alg.Alias.KeyGenerator", MiscObjectIdentifiers.cryptlib_algorithm_blowfish_CBC, "BLOWFISH");
    provider.addAlgorithm("AlgorithmParameters.BLOWFISH", PREFIX + "$AlgParams");
    provider.addAlgorithm("Alg.Alias.AlgorithmParameters", MiscObjectIdentifiers.cryptlib_algorithm_blowfish_CBC, "BLOWFISH");

}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:13,代码来源:Blowfish.java


示例4: configure

import org.bouncycastle.asn1.misc.MiscObjectIdentifiers; //导入依赖的package包/类
public void configure(ConfigurableProvider provider)
{
    provider.addAlgorithm("MessageDigest.BLAKE2B-512", PREFIX + "$Blake2b512");
    provider.addAlgorithm("Alg.Alias.MessageDigest." + MiscObjectIdentifiers.id_blake2b512, "BLAKE2B-512");

    provider.addAlgorithm("MessageDigest.BLAKE2B-384", PREFIX + "$Blake2b384");
    provider.addAlgorithm("Alg.Alias.MessageDigest." + MiscObjectIdentifiers.id_blake2b384, "BLAKE2B-384");

    provider.addAlgorithm("MessageDigest.BLAKE2B-256", PREFIX + "$Blake2b256");
    provider.addAlgorithm("Alg.Alias.MessageDigest." + MiscObjectIdentifiers.id_blake2b256, "BLAKE2B-256");

    provider.addAlgorithm("MessageDigest.BLAKE2B-160", PREFIX + "$Blake2b160");
    provider.addAlgorithm("Alg.Alias.MessageDigest." + MiscObjectIdentifiers.id_blake2b160, "BLAKE2B-160");
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:15,代码来源:Blake2b.java


示例5: generateSSLServerCertificate

import org.bouncycastle.asn1.misc.MiscObjectIdentifiers; //导入依赖的package包/类
private void generateSSLServerCertificate(KeyStore store, X500PrivateCredential rootCredential)
	throws Exception
{
	LOG.info("Generating SSL server certificate ...");
	KeyPair pair = CertificateUtilities.generateRSAKeyPair(getCryptoStrength());
	String DN = "CN=localhost, " + DN_ROOT;
	X509V3CertificateGenerator v3CertGen = CertificateUtilities.initCertificateGenerator(pair, rootCredential
			.getCertificate().getSubjectX500Principal().getName(), DN, false, CertificateUtilities.DEFAULT_VALIDITY_PERIOD);

	v3CertGen.addExtension(X509Extensions.BasicConstraints, true, new BasicConstraints(false));

	v3CertGen.addExtension(MiscObjectIdentifiers.netscapeCertType, false, new NetscapeCertType(NetscapeCertType.sslServer
			| NetscapeCertType.sslClient));

	// Firefox 2 disallows these extensions in an SSL server cert. IE7 doesn't care.
	// v3CertGen.addExtension(X509Extensions.KeyUsage,
	// true, new KeyUsage(KeyUsage.dataEncipherment | KeyUsage.keyAgreement |
	// KeyUsage.keyEncipherment));

	Vector<KeyPurposeId> typicalSSLServerExtendedKeyUsages = new Vector<KeyPurposeId>();

	typicalSSLServerExtendedKeyUsages.add(KeyPurposeId.id_kp_serverAuth);
	typicalSSLServerExtendedKeyUsages.add(KeyPurposeId.id_kp_clientAuth);

	v3CertGen.addExtension(X509Extensions.ExtendedKeyUsage, false, new ExtendedKeyUsage(typicalSSLServerExtendedKeyUsages));

	X509Certificate publicKeyCertificate = v3CertGen.generate(pair.getPrivate());
	store.setKeyEntry(MAILSTER_SSL_ALIAS, pair.getPrivate(), KEYSTORE_PASSWORD, new Certificate[] {publicKeyCertificate,
			rootCredential.getCertificate()});
	CertificateUtilities.exportCertificate(publicKeyCertificate, SSL_CERT_FULL_PATH, false);
}
 
开发者ID:edeoliveira,项目名称:Mailster,代码行数:32,代码来源:MailsterKeyStoreFactory.java


示例6: generateRootCert

import org.bouncycastle.asn1.misc.MiscObjectIdentifiers; //导入依赖的package包/类
/**
 * Generate a CA Root certificate.
 */
private static X509Certificate generateRootCert(String DN, KeyPair pair)
    throws Exception
{
    X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();
    certGen.setIssuerDN(new X509Name(true, X509Name.DefaultLookUp, DN));
    certGen.setSubjectDN(new X509Name(true, X509Name.DefaultLookUp, DN));   
    
    setSerialNumberAndValidityPeriod(certGen, true, DEFAULT_VALIDITY_PERIOD);  

    certGen.setPublicKey(pair.getPublic());
    certGen.setSignatureAlgorithm("SHA1WithRSAEncryption");
    
    certGen.addExtension(X509Extensions.AuthorityKeyIdentifier, 
            false, new AuthorityKeyIdentifier(
                    new GeneralNames(new GeneralName(new X509Name(true, X509Name.DefaultLookUp, DN))), 
                    BigInteger.ONE));
    certGen.addExtension(X509Extensions.SubjectKeyIdentifier, 
            false, new SubjectKeyIdentifierStructure(pair.getPublic()));
    
    certGen.addExtension(X509Extensions.BasicConstraints, 
            true, new BasicConstraints(true));
    certGen.addExtension(X509Extensions.KeyUsage, 
            true, new KeyUsage(KeyUsage.keyCertSign | KeyUsage.cRLSign | KeyUsage.nonRepudiation));
    certGen.addExtension(MiscObjectIdentifiers.netscapeCertType, 
            false, new NetscapeCertType(NetscapeCertType.smimeCA | 
                    NetscapeCertType.sslCA | NetscapeCertType.objectSigning));
    
    return certGen.generate(pair.getPrivate(), "BC");
}
 
开发者ID:edeoliveira,项目名称:Mailster,代码行数:33,代码来源:CertificateUtilities.java


示例7: createClientCert

import org.bouncycastle.asn1.misc.MiscObjectIdentifiers; //导入依赖的package包/类
/**
 * we generate a certificate signed by our CA's intermediate certficate
 */
public static X509Certificate createClientCert(
    PublicKey       pubKey,
    PrivateKey      caPrivKey,
    PublicKey       caPubKey)
    throws Exception
{
    //
    // issuer
    //
    String  issuer = "C=AU, O=The Legion of the Bouncy Castle, OU=Bouncy Primary Certificate";

    //
    // subjects name table.
    //
    Hashtable                   attrs = new Hashtable();
    Vector                      order = new Vector();

    attrs.put(X509Principal.C, "AU");
    attrs.put(X509Principal.O, "The Legion of the Bouncy Castle");
    attrs.put(X509Principal.L, "Melbourne");
    attrs.put(X509Principal.CN, "Eric H. Echidna");
    attrs.put(X509Principal.EmailAddress, "[email protected]");

    order.addElement(X509Principal.C);
    order.addElement(X509Principal.O);
    order.addElement(X509Principal.L);
    order.addElement(X509Principal.CN);
    order.addElement(X509Principal.EmailAddress);

    //
    // create the certificate - version 3
    //
    v3CertGen.reset();

    v3CertGen.setSerialNumber(BigInteger.valueOf(20));
    v3CertGen.setIssuerDN(new X509Principal(issuer));
    v3CertGen.setNotBefore(new Date(System.currentTimeMillis() - 1000L * 60 * 60 * 24 * 30));
    v3CertGen.setNotAfter(new Date(System.currentTimeMillis() + (1000L * 60 * 60 * 24 * 30)));
    v3CertGen.setSubjectDN(new X509Principal(order, attrs));
    v3CertGen.setPublicKey(pubKey);
    v3CertGen.setSignatureAlgorithm("SHA1WithRSAEncryption");

    //
    // add the extensions
    //

    v3CertGen.addExtension(
        MiscObjectIdentifiers.netscapeCertType,
        false,
        new NetscapeCertType(NetscapeCertType.objectSigning | NetscapeCertType.smime));

    X509Certificate cert = v3CertGen.generate(caPrivKey);

    cert.checkValidity(new Date());

    cert.verify(caPubKey);

    return cert;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:63,代码来源:AttrCertExample.java


示例8: configure

import org.bouncycastle.asn1.misc.MiscObjectIdentifiers; //导入依赖的package包/类
public void configure(ConfigurableProvider provider)
{

    provider.addAlgorithm("AlgorithmParameters.CAST5", PREFIX + "$AlgParams");
    provider.addAlgorithm("Alg.Alias.AlgorithmParameters.1.2.840.113533.7.66.10", "CAST5");

    provider.addAlgorithm("AlgorithmParameterGenerator.CAST5", PREFIX + "$AlgParamGen");
    provider.addAlgorithm("Alg.Alias.AlgorithmParameterGenerator.1.2.840.113533.7.66.10", "CAST5");

    provider.addAlgorithm("Cipher.CAST5", PREFIX + "$ECB");
    provider.addAlgorithm("Cipher", MiscObjectIdentifiers.cast5CBC, PREFIX + "$CBC");

    provider.addAlgorithm("KeyGenerator.CAST5", PREFIX + "$KeyGen");
    provider.addAlgorithm("Alg.Alias.KeyGenerator", MiscObjectIdentifiers.cast5CBC, "CAST5");

}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:17,代码来源:CAST5.java


示例9: createClientCert

import org.bouncycastle.asn1.misc.MiscObjectIdentifiers; //导入依赖的package包/类
/**
 * we generate a certificate signed by our CA's intermediate certficate
 */
public static X509Certificate createClientCert(
    PublicKey       pubKey,
    PrivateKey      caPrivKey,
    PublicKey       caPubKey)
    throws Exception
{
    //
    // issuer
    //
    String  issuer = "C=AU, O=The Legion of the Bouncy Castle, OU=Bouncy Primary Certificate";

    //
    // subjects name table.
    //
    Hashtable                   attrs = new Hashtable();
    Vector                      order = new Vector();

    attrs.put(X509Principal.C, "AU");
    attrs.put(X509Principal.O, "The Legion of the Bouncy Castle");
    attrs.put(X509Principal.L, "Melbourne");
    attrs.put(X509Principal.CN, "Eric H. Echidna");
    attrs.put(X509Principal.EmailAddress, "[email protected]");

    order.addElement(X509Principal.C);
    order.addElement(X509Principal.O);
    order.addElement(X509Principal.L);
    order.addElement(X509Principal.CN);
    order.addElement(X509Principal.EmailAddress);

    //
    // create the certificate - version 3
    //
    v3CertGen.reset();

    v3CertGen.setSerialNumber(BigInteger.valueOf(20));
    v3CertGen.setIssuerDN(new X509Principal(issuer));
    v3CertGen.setNotBefore(new Date(System.currentTimeMillis() - 1000L * 60 * 60 * 24 * 30));
    v3CertGen.setNotAfter(new Date(System.currentTimeMillis() + (1000L * 60 * 60 * 24 * 30)));
    v3CertGen.setSubjectDN(new X509Principal(order, attrs));
    v3CertGen.setPublicKey(pubKey);
    v3CertGen.setSignatureAlgorithm("SHA1WithRSAEncryption");

    //
    // add the extensions
    //

    v3CertGen.addExtension(
        MiscObjectIdentifiers.netscapeCertType,
        false,
        new NetscapeCertType(NetscapeCertType.objectSigning | NetscapeCertType.smime));

    X509Certificate cert = v3CertGen.generateX509Certificate(caPrivKey);

    cert.checkValidity(new Date());

    cert.verify(caPubKey);

    return cert;
}
 
开发者ID:credentials,项目名称:irma_future_id,代码行数:63,代码来源:AttrCertExample.java



注:本文中的org.bouncycastle.asn1.misc.MiscObjectIdentifiers类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ElementChange类代码示例发布时间:2022-05-22
下一篇:
Java BaseConstructor类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap