引言
本文是对Java Crypto API的解读 。Java Cryptography API允许你对数据进行加解密操作,同时进行秘钥管理,签名等操作。
Java加解密服务涉及的包有:
java.security
java.security.cert
java.security.spec
java.security.interfaces
javax.crypto
javax.crypto.spec
javax.crypto.interfaces
核心类为:
Provider
SecureRandom
Cipher
MessageDigest
Signature
Mac
AlgorithmParameters
AlgorithmParameterGenerator
KeyFactory
SecretKeyFactory
KeyPairGenerator
KeyGenerator
KeyAgreement
KeyStore
CertificateFactory
CertPathBuilder
CertPathValidator
CertStore
Provider
java.security.Provider是指Java算法提供商,要使用Java Crypto API,你必须提供一个Provider,JDK拥有自己的实现,如果你未提供Provider,默认使用JDK提供的Provider.目前,最流行的Provider为BouncyCastleProvider