当前位置: 首页>>代码示例>>Java>>正文


Java NISTObjectIdentifiers类代码示例

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


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

示例1: determineKeyEncAlg

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入依赖的package包/类
static AlgorithmIdentifier determineKeyEncAlg(KeyParameter key)
{
    int length = key.getKey().length * 8;
    ASN1ObjectIdentifier wrapOid;

    if (length == 128)
    {
        wrapOid = NISTObjectIdentifiers.id_aes128_wrap;
    }
    else if (length == 192)
    {
        wrapOid = NISTObjectIdentifiers.id_aes192_wrap;
    }
    else if (length == 256)
    {
        wrapOid = NISTObjectIdentifiers.id_aes256_wrap;
    }
    else
    {
        throw new IllegalArgumentException("illegal keysize in AES");
    }

    return new AlgorithmIdentifier(wrapOid); // parameters absent
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:25,代码来源:AESUtil.java

示例2: getOIDForHashAlgorithm

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入依赖的package包/类
public static ASN1ObjectIdentifier getOIDForHashAlgorithm(int hashAlgorithm)
{
    switch (hashAlgorithm)
    {
    case HashAlgorithm.md5:
        return PKCSObjectIdentifiers.md5;
    case HashAlgorithm.sha1:
        return X509ObjectIdentifiers.id_SHA1;
    case HashAlgorithm.sha224:
        return NISTObjectIdentifiers.id_sha224;
    case HashAlgorithm.sha256:
        return NISTObjectIdentifiers.id_sha256;
    case HashAlgorithm.sha384:
        return NISTObjectIdentifiers.id_sha384;
    case HashAlgorithm.sha512:
        return NISTObjectIdentifiers.id_sha512;
    default:
        throw new IllegalArgumentException("unknown HashAlgorithm");
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:21,代码来源:TlsUtils.java

示例3: configure

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入依赖的package包/类
public void configure(ConfigurableProvider provider)
{
    provider.addAlgorithm("MessageDigest.SHA-512", PREFIX + "$Digest");
    provider.addAlgorithm("Alg.Alias.MessageDigest.SHA512", "SHA-512");
    provider.addAlgorithm("Alg.Alias.MessageDigest." + NISTObjectIdentifiers.id_sha512, "SHA-512");

    provider.addAlgorithm("MessageDigest.SHA-512/224", PREFIX + "$DigestT224");
    provider.addAlgorithm("Alg.Alias.MessageDigest.SHA512/224", "SHA-512/224");
    provider.addAlgorithm("Alg.Alias.MessageDigest." + NISTObjectIdentifiers.id_sha512_224, "SHA-512/224");

    provider.addAlgorithm("MessageDigest.SHA-512/256", PREFIX + "$DigestT256");
    provider.addAlgorithm("Alg.Alias.MessageDigest.SHA512256", "SHA-512/256");
    provider.addAlgorithm("Alg.Alias.MessageDigest." + NISTObjectIdentifiers.id_sha512_256, "SHA-512/256");

    provider.addAlgorithm("Mac.OLDHMACSHA512", PREFIX + "$OldSHA512");

    addHMACAlgorithm(provider, "SHA512", PREFIX + "$HashMac",  PREFIX + "$KeyGenerator");
    addHMACAlias(provider, "SHA512", PKCSObjectIdentifiers.id_hmacWithSHA512);

    addHMACAlgorithm(provider, "SHA512/224", PREFIX + "$HashMacT224",  PREFIX + "$KeyGeneratorT224");
    addHMACAlgorithm(provider, "SHA512/256", PREFIX + "$HashMacT256",  PREFIX + "$KeyGeneratorT256");
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:23,代码来源:SHA512.java

示例4: createRFC3211Wrapper

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入依赖的package包/类
static Wrapper createRFC3211Wrapper(ASN1ObjectIdentifier algorithm)
    throws CMSException
{
    if (NISTObjectIdentifiers.id_aes128_CBC.equals(algorithm)
        || NISTObjectIdentifiers.id_aes192_CBC.equals(algorithm)
        || NISTObjectIdentifiers.id_aes256_CBC.equals(algorithm))
    {
        return new RFC3211WrapEngine(new AESEngine());
    }
    else if (PKCSObjectIdentifiers.des_EDE3_CBC.equals(algorithm))
    {
        return new RFC3211WrapEngine(new DESedeEngine());
    }
    else if (OIWObjectIdentifiers.desCBC.equals(algorithm))
    {
        return new RFC3211WrapEngine(new DESEngine());
    }
    else if (PKCSObjectIdentifiers.RC2_CBC.equals(algorithm))
    {
        return new RFC3211WrapEngine(new RC2Engine());
    }
    else
    {
        throw new CMSException("cannot recognise wrapper: " + algorithm);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:27,代码来源:EnvelopedDataHelper.java

示例5: isRSASigAlgId

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入依赖的package包/类
public static boolean isRSASigAlgId(AlgorithmIdentifier algId) {
    ParamUtil.requireNonNull("algId", algId);
    ASN1ObjectIdentifier oid = algId.getAlgorithm();
    if (PKCSObjectIdentifiers.sha1WithRSAEncryption.equals(oid)
            || PKCSObjectIdentifiers.sha224WithRSAEncryption.equals(oid)
            || PKCSObjectIdentifiers.sha256WithRSAEncryption.equals(oid)
            || PKCSObjectIdentifiers.sha384WithRSAEncryption.equals(oid)
            || PKCSObjectIdentifiers.sha512WithRSAEncryption.equals(oid)
            || NISTObjectIdentifiers.id_rsassa_pkcs1_v1_5_with_sha3_224.equals(oid)
            || NISTObjectIdentifiers.id_rsassa_pkcs1_v1_5_with_sha3_256.equals(oid)
            || NISTObjectIdentifiers.id_rsassa_pkcs1_v1_5_with_sha3_384.equals(oid)
            || NISTObjectIdentifiers.id_rsassa_pkcs1_v1_5_with_sha3_512.equals(oid)
            || PKCSObjectIdentifiers.id_RSASSA_PSS.equals(oid)) {
        return true;
    }

    return false;
}
 
开发者ID:xipki,项目名称:xitk,代码行数:19,代码来源:AlgorithmUtil.java

示例6: isECDSASigAlg

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入依赖的package包/类
private static boolean isECDSASigAlg(AlgorithmIdentifier algId) {
    ParamUtil.requireNonNull("algId", algId);

    ASN1ObjectIdentifier oid = algId.getAlgorithm();
    if (X9ObjectIdentifiers.ecdsa_with_SHA1.equals(oid)
            || X9ObjectIdentifiers.ecdsa_with_SHA224.equals(oid)
            || X9ObjectIdentifiers.ecdsa_with_SHA256.equals(oid)
            || X9ObjectIdentifiers.ecdsa_with_SHA384.equals(oid)
            || X9ObjectIdentifiers.ecdsa_with_SHA512.equals(oid)
            || NISTObjectIdentifiers.id_ecdsa_with_sha3_224.equals(oid)
            || NISTObjectIdentifiers.id_ecdsa_with_sha3_256.equals(oid)
            || NISTObjectIdentifiers.id_ecdsa_with_sha3_384.equals(oid)
            || NISTObjectIdentifiers.id_ecdsa_with_sha3_512.equals(oid)) {
        return true;
    }

    return false;
}
 
开发者ID:xipki,项目名称:xitk,代码行数:19,代码来源:AlgorithmUtil.java

示例7: isDSASigAlg

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入依赖的package包/类
public static boolean isDSASigAlg(AlgorithmIdentifier algId) {
    ParamUtil.requireNonNull("algId", algId);

    ASN1ObjectIdentifier oid = algId.getAlgorithm();
    if (X9ObjectIdentifiers.id_dsa_with_sha1.equals(oid)
            || NISTObjectIdentifiers.dsa_with_sha224.equals(oid)
            || NISTObjectIdentifiers.dsa_with_sha256.equals(oid)
            || NISTObjectIdentifiers.dsa_with_sha384.equals(oid)
            || NISTObjectIdentifiers.dsa_with_sha512.equals(oid)
            || NISTObjectIdentifiers.id_dsa_with_sha3_224.equals(oid)
            || NISTObjectIdentifiers.id_dsa_with_sha3_256.equals(oid)
            || NISTObjectIdentifiers.id_dsa_with_sha3_384.equals(oid)
            || NISTObjectIdentifiers.id_dsa_with_sha3_512.equals(oid)) {
        return true;
    }

    return false;
}
 
开发者ID:xipki,项目名称:xitk,代码行数:19,代码来源:AlgorithmUtil.java

示例8: getOIDForHashAlgorithm

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入依赖的package包/类
public static ASN1ObjectIdentifier getOIDForHashAlgorithm(short hashAlgorithm)
{
    switch (hashAlgorithm)
    {
    case HashAlgorithm.md5:
        return PKCSObjectIdentifiers.md5;
    case HashAlgorithm.sha1:
        return X509ObjectIdentifiers.id_SHA1;
    case HashAlgorithm.sha224:
        return NISTObjectIdentifiers.id_sha224;
    case HashAlgorithm.sha256:
        return NISTObjectIdentifiers.id_sha256;
    case HashAlgorithm.sha384:
        return NISTObjectIdentifiers.id_sha384;
    case HashAlgorithm.sha512:
        return NISTObjectIdentifiers.id_sha512;
    default:
        throw new IllegalArgumentException("unknown HashAlgorithm");
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:21,代码来源:TlsUtils.java

示例9: getValue

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入依赖的package包/类
@Override
	public Attribute getValue() throws SignerException {
		try {
			X509Certificate cert = (X509Certificate) certificates[0];
			X509Certificate issuerCert = (X509Certificate) certificates[1];
			Digest digest = DigestFactory.getInstance().factoryDefault();
			digest.setAlgorithm(DigestAlgorithmEnum.SHA_256);
			byte[] certHash = digest.digest(cert.getEncoded());
			X500Name dirName = new X500Name(issuerCert.getSubjectX500Principal().getName());
			GeneralName name = new GeneralName(dirName);
			GeneralNames issuer = new GeneralNames(name);
			ASN1Integer serialNumber = new ASN1Integer(cert.getSerialNumber());
			IssuerSerial issuerSerial = new IssuerSerial(issuer, serialNumber);
			AlgorithmIdentifier algId = new AlgorithmIdentifier(NISTObjectIdentifiers.id_sha256);// SHA-256
			ESSCertIDv2 essCertIDv2 = new ESSCertIDv2(algId, certHash, issuerSerial);
//			return new Attribute(new ASN1ObjectIdentifier(identifier), new DERSet(new DERSequence(essCertIDv2)));
			return new Attribute(new ASN1ObjectIdentifier(identifier), new DERSet(new DERSequence(
					new ASN1Encodable[] { new DERSequence(essCertIDv2) })));
		} catch (CertificateEncodingException ex) {
			throw new SignerException(ex.getMessage());
		}
	}
 
开发者ID:demoiselle,项目名称:signer,代码行数:23,代码来源:SigningCertificateV2.java

示例10: getAlgorithm

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入依赖的package包/类
protected static String getAlgorithm(String algDetails)
{
    if (algDetails.indexOf('[') > 0)
    {
        return algDetails.substring(0, algDetails.indexOf('['));
    }

    if (algDetails.startsWith(NISTObjectIdentifiers.aes.getId()))
    {
        return "AES";
    }
    if (algDetails.startsWith(GNUObjectIdentifiers.Serpent.getId()))
    {
        return "Serpent";
    }

    String name = (String)nameTable.get(Strings.toUpperCase(algDetails));

    if (name != null)
    {
        return name;
    }

    return algDetails;
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:26,代码来源:BaseAgreementSpi.java

示例11: DefaultSecretKeyProvider

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入依赖的package包/类
DefaultSecretKeyProvider()
{
    Map keySizes = new HashMap();

    keySizes.put(new ASN1ObjectIdentifier("1.2.840.113533.7.66.10"), Integers.valueOf(128));

    keySizes.put(PKCSObjectIdentifiers.des_EDE3_CBC, Integers.valueOf(192));

    keySizes.put(NISTObjectIdentifiers.id_aes128_CBC, Integers.valueOf(128));
    keySizes.put(NISTObjectIdentifiers.id_aes192_CBC, Integers.valueOf(192));
    keySizes.put(NISTObjectIdentifiers.id_aes256_CBC, Integers.valueOf(256));

    keySizes.put(NTTObjectIdentifiers.id_camellia128_cbc, Integers.valueOf(128));
    keySizes.put(NTTObjectIdentifiers.id_camellia192_cbc, Integers.valueOf(192));
    keySizes.put(NTTObjectIdentifiers.id_camellia256_cbc, Integers.valueOf(256));

    keySizes.put(CryptoProObjectIdentifiers.gostR28147_gcfb, Integers.valueOf(256));

    KEY_SIZES = Collections.unmodifiableMap(keySizes);
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:21,代码来源:PKCS12KeyStoreSpi.java

示例12: DefaultSecretKeyProvider

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入依赖的package包/类
DefaultSecretKeyProvider()
{
    Map keySizes = new HashMap();

    keySizes.put(new ASN1ObjectIdentifier("1.2.840.113533.7.66.10"), Integers.valueOf(128));

    keySizes.put(PKCSObjectIdentifiers.des_EDE3_CBC.getId(), Integers.valueOf(192));

    keySizes.put(NISTObjectIdentifiers.id_aes128_CBC, Integers.valueOf(128));
    keySizes.put(NISTObjectIdentifiers.id_aes192_CBC, Integers.valueOf(192));
    keySizes.put(NISTObjectIdentifiers.id_aes256_CBC, Integers.valueOf(256));

    keySizes.put(NTTObjectIdentifiers.id_camellia128_cbc, Integers.valueOf(128));
    keySizes.put(NTTObjectIdentifiers.id_camellia192_cbc, Integers.valueOf(192));
    keySizes.put(NTTObjectIdentifiers.id_camellia256_cbc, Integers.valueOf(256));

    keySizes.put(CryptoProObjectIdentifiers.gostR28147_gcfb, Integers.valueOf(256));

    KEY_SIZES = Collections.unmodifiableMap(keySizes);
}
 
开发者ID:NoYouShutup,项目名称:CryptMeme,代码行数:21,代码来源:PKCS12KeyStoreSpi.java

示例13: configure

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入依赖的package包/类
public void configure(ConfigurableProvider provider)
{
    provider.addAlgorithm("MessageDigest.SHA-384", PREFIX + "$Digest");
    provider.addAlgorithm("Alg.Alias.MessageDigest.SHA384", "SHA-384");
    provider.addAlgorithm("Alg.Alias.MessageDigest." + NISTObjectIdentifiers.id_sha384, "SHA-384");
    provider.addAlgorithm("Mac.OLDHMACSHA384", PREFIX + "$OldSHA384");

    addHMACAlgorithm(provider, "SHA384", PREFIX + "$HashMac",  PREFIX + "$KeyGenerator");
    addHMACAlias(provider, "SHA384", PKCSObjectIdentifiers.id_hmacWithSHA384);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:11,代码来源:SHA384.java

示例14: configure

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入依赖的package包/类
public void configure(ConfigurableProvider provider)
{
    provider.addAlgorithm("MessageDigest.SHA-224", PREFIX + "$Digest");
    provider.addAlgorithm("Alg.Alias.MessageDigest.SHA224", "SHA-224");
    provider.addAlgorithm("Alg.Alias.MessageDigest." + NISTObjectIdentifiers.id_sha224, "SHA-224");

    addHMACAlgorithm(provider, "SHA224", PREFIX + "$HashMac",  PREFIX + "$KeyGenerator");
    addHMACAlias(provider, "SHA224", PKCSObjectIdentifiers.id_hmacWithSHA224);

}
 
开发者ID:Appdome,项目名称:ipack,代码行数:11,代码来源:SHA224.java

示例15: configure

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入依赖的package包/类
public void configure(ConfigurableProvider provider)
{
    provider.addAlgorithm("MessageDigest.SHA-256", PREFIX + "$Digest");
    provider.addAlgorithm("Alg.Alias.MessageDigest.SHA256", "SHA-256");
    provider.addAlgorithm("Alg.Alias.MessageDigest." + NISTObjectIdentifiers.id_sha256, "SHA-256");

    provider.addAlgorithm("SecretKeyFactory.PBEWITHHMACSHA256", PREFIX + "$PBEWithMacKeyFactory");
    provider.addAlgorithm("Alg.Alias.SecretKeyFactory.PBEWITHHMACSHA-256", "PBEWITHHMACSHA256");
    provider.addAlgorithm("Alg.Alias.SecretKeyFactory." + NISTObjectIdentifiers.id_sha256, "PBEWITHHMACSHA256");

    addHMACAlgorithm(provider, "SHA256", PREFIX + "$HashMac",  PREFIX + "$KeyGenerator");
    addHMACAlias(provider, "SHA256", PKCSObjectIdentifiers.id_hmacWithSHA256);
    addHMACAlias(provider, "SHA256", NISTObjectIdentifiers.id_sha256);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:15,代码来源:SHA256.java


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