Java支持的加密算法

版权声明:转载请注明出处 https://blog.csdn.net/lvhonglei1987/article/details/89454118

public static void registerDefaultAlgorithms() {
algorithmsMap.put(
MessageDigestAlgorithm.ALGO_ID_DIGEST_NOT_RECOMMENDED_MD5,
new Algorithm("", “MD5”, “MessageDigest”)
);
algorithmsMap.put(
MessageDigestAlgorithm.ALGO_ID_DIGEST_RIPEMD160,
new Algorithm("", “RIPEMD160”, “MessageDigest”)
);
algorithmsMap.put(
MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1,
new Algorithm("", “SHA-1”, “MessageDigest”)
);
algorithmsMap.put(
MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA256,
new Algorithm("", “SHA-256”, “MessageDigest”)
);
algorithmsMap.put(
MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA384,
new Algorithm("", “SHA-384”, “MessageDigest”)
);
algorithmsMap.put(
MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA512,
new Algorithm("", “SHA-512”, “MessageDigest”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_SIGNATURE_DSA,
new Algorithm("", “SHA1withDSA”, “Signature”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_SIGNATURE_DSA_SHA256,
new Algorithm("", “SHA256withDSA”, “Signature”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5,
new Algorithm("", “MD5withRSA”, “Signature”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_SIGNATURE_RSA_RIPEMD160,
new Algorithm("", “RIPEMD160withRSA”, “Signature”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1,
new Algorithm("", “SHA1withRSA”, “Signature”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA256,
new Algorithm("", “SHA256withRSA”, “Signature”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA384,
new Algorithm("", “SHA384withRSA”, “Signature”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA512,
new Algorithm("", “SHA512withRSA”, “Signature”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA1,
new Algorithm("", “SHA1withECDSA”, “Signature”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA256,
new Algorithm("", “SHA256withECDSA”, “Signature”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA384,
new Algorithm("", “SHA384withECDSA”, “Signature”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA512,
new Algorithm("", “SHA512withECDSA”, “Signature”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5,
new Algorithm("", “HmacMD5”, “Mac”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_MAC_HMAC_RIPEMD160,
new Algorithm("", “HMACRIPEMD160”, “Mac”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_MAC_HMAC_SHA1,
new Algorithm("", “HmacSHA1”, “Mac”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_MAC_HMAC_SHA256,
new Algorithm("", “HmacSHA256”, “Mac”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_MAC_HMAC_SHA384,
new Algorithm("", “HmacSHA384”, “Mac”)
);
algorithmsMap.put(
XMLSignature.ALGO_ID_MAC_HMAC_SHA512,
new Algorithm("", “HmacSHA512”, “Mac”)
);
algorithmsMap.put(
XMLCipher.TRIPLEDES,
new Algorithm(“DESede”, “DESede/CBC/ISO10126Padding”, “BlockEncryption”, 192)
);
algorithmsMap.put(
XMLCipher.AES_128,
new Algorithm(“AES”, “AES/CBC/ISO10126Padding”, “BlockEncryption”, 128)
);
algorithmsMap.put(
XMLCipher.AES_192,
new Algorithm(“AES”, “AES/CBC/ISO10126Padding”, “BlockEncryption”, 192)
);
algorithmsMap.put(
XMLCipher.AES_256,
new Algorithm(“AES”, “AES/CBC/ISO10126Padding”, “BlockEncryption”, 256)
);
algorithmsMap.put(
XMLCipher.AES_128_GCM,
new Algorithm(“AES”, “AES/GCM/NoPadding”, “BlockEncryption”, 128)
);
algorithmsMap.put(
XMLCipher.AES_192_GCM,
new Algorithm(“AES”, “AES/GCM/NoPadding”, “BlockEncryption”, 192)
);
algorithmsMap.put(
XMLCipher.AES_256_GCM,
new Algorithm(“AES”, “AES/GCM/NoPadding”, “BlockEncryption”, 256)
);
algorithmsMap.put(
XMLCipher.RSA_v1dot5,
new Algorithm(“RSA”, “RSA/ECB/PKCS1Padding”, “KeyTransport”)
);
algorithmsMap.put(
XMLCipher.RSA_OAEP,
new Algorithm(“RSA”, “RSA/ECB/OAEPPadding”, “KeyTransport”)
);
algorithmsMap.put(
XMLCipher.RSA_OAEP_11,
new Algorithm(“RSA”, “RSA/ECB/OAEPPadding”, “KeyTransport”)
);
algorithmsMap.put(
XMLCipher.DIFFIE_HELLMAN,
new Algorithm("", “”, “KeyAgreement”)
);
algorithmsMap.put(
XMLCipher.TRIPLEDES_KeyWrap,
new Algorithm(“DESede”, “DESedeWrap”, “SymmetricKeyWrap”, 192)
);
algorithmsMap.put(
XMLCipher.AES_128_KeyWrap,
new Algorithm(“AES”, “AESWrap”, “SymmetricKeyWrap”, 128)
);
algorithmsMap.put(
XMLCipher.AES_192_KeyWrap,
new Algorithm(“AES”, “AESWrap”, “SymmetricKeyWrap”, 192)
);
algorithmsMap.put(
XMLCipher.AES_256_KeyWrap,
new Algorithm(“AES”, “AESWrap”, “SymmetricKeyWrap”, 256)
);
}

猜你喜欢

转载自blog.csdn.net/lvhonglei1987/article/details/89454118