接口的使用
java.security.Key
使用 Key 的包
包
描述
为安全框架提供类和接口。
提供用于生成 RSA(Rivest、Shamir 和 Adleman AsymmetricCipher 算法)密钥的接口,如 RSA 实验室技术说明 PKCS#1 中所定义,以及 DSA(数字签名算法)密钥,如 NIST 的 FIPS-186 中所定义。
提供用于加密操作的类和接口。
为 RSA 实验室的 PKCS #3 中定义的 Diffie-Hellman 密钥提供接口。
提供关键规范和算法参数规范的类和接口。
此包包含与 Kerberos 网络身份验证协议相关的实用程序类。
XML 加密的通用类。
javax.xml.crypto.dsig 包的 DOM 特定类。
-
Key 在 java.security 中的用法
java.security 中 Key 的子接口java.security 中返回 Key 的方法修饰符和类型方法描述abstract KeyKeyStoreSpi.engineGetKey(String alias, char[] password) 返回与给定别名关联的密钥,使用给定密码恢复它。protected abstract KeyKeyFactorySpi.engineTranslateKey(Key key) 将其提供者可能未知或可能不受信任的密钥对象转换为此密钥工厂的相应密钥对象。final Key返回与给定别名关联的密钥,使用给定密码恢复它。final KeyKeyFactory.translateKey(Key key) 将其提供者可能未知或可能不受信任的密钥对象转换为此密钥工厂的相应密钥对象。java.security 中的方法,参数类型为 Key修饰符和类型方法描述protected abstract <T extends KeySpec>
TKeyFactorySpi.engineGetKeySpec(Key key, Class<T> keySpec) 返回给定密钥对象的规范(密钥材料)。abstract voidKeyStoreSpi.engineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain) 将给定的密钥分配给给定的别名,用给定的密码保护它。protected abstract KeyKeyFactorySpi.engineTranslateKey(Key key) 将其提供者可能未知或可能不受信任的密钥对象转换为此密钥工厂的相应密钥对象。final <T extends KeySpec>
TKeyFactory.getKeySpec(Key key, Class<T> keySpec) 返回给定密钥对象的规范(密钥材料)。booleanAlgorithmConstraints.permits(Set<CryptoPrimitive> primitives, String algorithm, Key key, AlgorithmParameters parameters) 确定算法和相应的密钥是否被授予指定加密原语的权限。booleanAlgorithmConstraints.permits(Set<CryptoPrimitive> primitives, Key key) 确定密钥是否被授予指定加密原语的权限。final voidKeyStore.setKeyEntry(String alias, Key key, char[] password, Certificate[] chain) 将给定的密钥分配给给定的别名,用给定的密码保护它。final KeyKeyFactory.translateKey(Key key) 将其提供者可能未知或可能不受信任的密钥对象转换为此密钥工厂的相应密钥对象。 -
Key 在 java.security.interfaces 中的用法
java.security.interfaces 中 Key 的子接口修饰符和类型接口描述interfaceDSA 私钥的标准接口。interfaceDSA 公钥的接口。interface椭圆曲线 (EC) 私钥的接口。interface椭圆曲线 (EC) 公钥的接口。interfaceRFC 8032:爱德华兹曲线数字签名算法 (EdDSA) 定义的椭圆曲线私钥的接口。interfaceRFC 8032:爱德华兹曲线数字签名算法 (EdDSA) 定义的椭圆曲线公钥接口。interfacePKCS#1 v2.2 标准中定义的 RSA 多素数私钥的接口,使用中国剩余定理(CRT) 信息值。interfacePKCS#1 v2.2 标准中定义的 RSA 私钥接口,使用中国剩余定理(CRT) 信息值。interfaceRSA 私钥的接口。interfaceRSA 公钥的接口。interfaceRFC 7748 定义的椭圆曲线私钥的接口。interfaceRFC 7748 定义的椭圆曲线公钥接口。 -
Key 在 javax.crypto 中的用法
javax.crypto 中 Key 的子接口javax.crypto 中返回 Key 的方法修饰符和类型方法描述final Key参与此密钥协议的其他方之一收到的给定密钥执行此密钥协议的下一阶段。protected abstract KeyKeyAgreementSpi.engineDoPhase(Key key, boolean lastPhase) 参与此密钥协议的其他方之一收到的给定密钥执行此密钥协议的下一阶段。protected KeyCipherSpi.engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) 打开先前包装的密钥。final Key打开先前包装的密钥。javax.crypto 中的方法,参数类型为 Key修饰符和类型方法描述final Key参与此密钥协议的其他方之一收到的给定密钥执行此密钥协议的下一阶段。protected abstract KeyKeyAgreementSpi.engineDoPhase(Key key, boolean lastPhase) 参与此密钥协议的其他方之一收到的给定密钥执行此密钥协议的下一阶段。protected intCipherSpi.engineGetKeySize(Key key) 以位为单位返回给定密钥对象的密钥大小。protected abstract voidCipherSpi.engineInit(int opmode, Key key, AlgorithmParameters params, SecureRandom random) 使用密钥、一组算法参数和随机源初始化此CipherSpi对象。protected abstract voidCipherSpi.engineInit(int opmode, Key key, SecureRandom random) 使用密钥和随机源初始化此CipherSpi对象。protected abstract voidCipherSpi.engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) 使用密钥、一组算法参数和随机源初始化此CipherSpi对象。protected abstract voidExemptionMechanismSpi.engineInit(Key key) 使用密钥初始化此豁免机制。protected abstract voidExemptionMechanismSpi.engineInit(Key key, AlgorithmParameters params) 使用密钥和一组算法参数初始化此豁免机制。protected abstract voidExemptionMechanismSpi.engineInit(Key key, AlgorithmParameterSpec params) 使用密钥和一组算法参数初始化此豁免机制。protected abstract voidKeyAgreementSpi.engineInit(Key key, SecureRandom random) 使用给定的密钥和随机源初始化此密钥协议。protected abstract voidKeyAgreementSpi.engineInit(Key key, AlgorithmParameterSpec params, SecureRandom random) 使用给定的密钥、算法参数集和随机源初始化此密钥协议。protected abstract voidMacSpi.engineInit(Key key, AlgorithmParameterSpec params) 使用给定的(秘密)密钥和算法参数初始化 MAC。protected byte[]CipherSpi.engineWrap(Key key) 包裹一把钥匙。EncryptedPrivateKeyInfo.getKeySpec(Key decryptKey) 从加密数据中提取封闭的 PKCS8EncodedKeySpec 对象并将其返回。EncryptedPrivateKeyInfo.getKeySpec(Key decryptKey, String providerName) 从加密数据中提取封闭的 PKCS8EncodedKeySpec 对象并将其返回。EncryptedPrivateKeyInfo.getKeySpec(Key decryptKey, Provider provider) 从加密数据中提取封闭的 PKCS8EncodedKeySpec 对象并将其返回。final Object检索原始(封装的)对象。final Object检索原始(封装的)对象。final void使用键初始化此Cipher对象。final voidCipher.init(int opmode, Key key, AlgorithmParameters params) 使用密钥和一组算法参数初始化此Cipher对象。final voidCipher.init(int opmode, Key key, AlgorithmParameters params, SecureRandom random) 使用密钥、一组算法参数和随机源初始化此Cipher对象。final voidCipher.init(int opmode, Key key, SecureRandom random) 使用密钥和随机源初始化此Cipher对象。final voidCipher.init(int opmode, Key key, AlgorithmParameterSpec params) 使用密钥和一组算法参数初始化此Cipher对象。final voidCipher.init(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) 使用密钥、一组算法参数和随机源初始化此Cipher对象。final void使用密钥初始化此豁免机制。final voidExemptionMechanism.init(Key key, AlgorithmParameters params) 使用密钥和一组算法参数初始化此豁免机制。final voidExemptionMechanism.init(Key key, AlgorithmParameterSpec params) 使用密钥和一组算法参数初始化此豁免机制。final void用给定的密钥初始化本次密钥协商,要求密钥中包含本次密钥协商所需的所有算法参数。final voidKeyAgreement.init(Key key, SecureRandom random) 使用给定的密钥和随机源初始化此密钥协议。final voidKeyAgreement.init(Key key, AlgorithmParameterSpec params) 使用给定的密钥和算法参数集初始化此密钥协议。final voidKeyAgreement.init(Key key, AlgorithmParameterSpec params, SecureRandom random) 使用给定的密钥、算法参数集和随机源初始化此密钥协议。final void使用给定的键初始化此Mac对象。final voidMac.init(Key key, AlgorithmParameterSpec params) 使用给定的密钥和算法参数初始化此Mac对象。final booleanExemptionMechanism.isCryptoAllowed(Key key) 返回结果 blob 是否已通过此免除机制成功生成。final byte[]包裹一把钥匙。 -
Key 在 javax.crypto.interfaces 中的用法
javax.crypto.interfaces 中 Key 的子接口修饰符和类型接口描述interfaceDiffie-Hellman 私钥的接口。interfaceDiffie-Hellman 公钥的接口。interfacePBE 密钥的接口。 -
Key 在 javax.crypto.spec 中的用法
javax.crypto.spec 中实现 Key 的类 -
Key 在 javax.security.auth.kerberos 中的用法
javax.security.auth.kerberos 中实现 Key 的类修饰符和类型类描述final class此类封装了 Kerberos 中使用的 EncryptionKey。class此类封装了 Kerberos 主体的长期密钥。 -
Key 在 javax.xml.crypto 中的用法
javax.xml.crypto 中返回 Key 的方法javax.xml.crypto 中的方法,参数类型为 Key修饰符和类型方法描述static KeySelectorKeySelector.singletonKeySelector(Key key) 返回始终选择指定键的KeySelector,而不管传递给它的KeyInfo。 -
Key 在 javax.xml.crypto.dsig.dom 中的用法
javax.xml.crypto.dsig.dom 中的构造函数,参数类型为 Key修饰符构造方法描述DOMSignContext(Key signingKey, Node parent) 使用指定的签名密钥和父节点创建DOMSignContext。DOMSignContext(Key signingKey, Node parent, Node nextSibling) 使用指定的签名密钥、父节点和下一个兄弟节点创建一个DOMSignContext。DOMValidateContext(Key validatingKey, Node node) 创建一个包含指定键和节点的DOMValidateContext。