类的用途
java.security.InvalidKeyException

使用 InvalidKeyException 的包
描述
为安全框架提供类和接口。
提供用于解析和管理证书、证书撤销列表 (CRL) 和证书路径的类和接口。
提供用于加密操作的类和接口。
提供关键规范和算法参数规范的类和接口。
提供公钥证书类。
  • InvalidKeyExceptionjava.security 中的用法

    修饰符和类型
    方法
    描述
    protected abstract void
    SignatureSpi.engineInitSign(PrivateKey privateKey)
    使用指定的私钥初始化此 Signature 对象以进行签名操作。
    protected void
    SignatureSpi.engineInitSign(PrivateKey privateKey, SecureRandom random)
    使用指定的私钥和签名操作的随机源初始化此 Signature 对象。
    protected abstract void
    SignatureSpi.engineInitVerify(PublicKey publicKey)
    使用指定的公钥初始化此 Signature 对象以进行验证操作。
    protected abstract Key
    KeyFactorySpi.engineTranslateKey(Key key)
    将其提供者可能未知或可能不受信任的密钥对象转换为此密钥工厂的相应密钥对象。
    final void
    Signature.initSign(PrivateKey privateKey)
    初始化此对象以进行签名。
    final void
    Signature.initSign(PrivateKey privateKey, SecureRandom random)
    初始化此对象以进行签名。
    final void
    Signature.initVerify(Certificate certificate)
    使用给定证书中的公钥初始化此对象以进行验证。
    final void
    Signature.initVerify(PublicKey publicKey)
    初始化此对象以进行验证。
    final Key
    KeyFactory.translateKey(Key key)
    将其提供者可能未知或可能不受信任的密钥对象转换为此密钥工厂的相应密钥对象。
    boolean
    SignedObject.verify(PublicKey verificationKey, Signature verificationEngine)
    使用指定的验证引擎,使用给定的验证密钥验证此 SignedObject 中的签名是存储在其中的对象的有效签名。
    java.security 中的构造函数抛出 InvalidKeyException
    修饰符
    构造方法
    描述
     
    SignedObject(Serializable object, PrivateKey signingKey, Signature signingEngine)
    从任何 Serializable 对象构造一个 SignedObject
  • InvalidKeyExceptionjava.security.cert 中的用法

    修饰符和类型
    方法
    描述
    abstract void
    Certificate.verify(PublicKey key)
    验证此证书是否使用与指定公钥相对应的私钥签名。
    abstract void
    Certificate.verify(PublicKey key, String sigProvider)
    验证此证书是否使用与指定公钥相对应的私钥签名。
    void
    Certificate.verify(PublicKey key, Provider sigProvider)
    验证此证书是否使用与指定公钥相对应的私钥签名。
    void
    X509Certificate.verify(PublicKey key, Provider sigProvider)
    验证此证书是否使用与指定公钥相对应的私钥签名。
    abstract void
    X509CRL.verify(PublicKey key)
    验证此 CRL 是否使用与给定公钥相对应的私钥签名。
    abstract void
    X509CRL.verify(PublicKey key, String sigProvider)
    验证此 CRL 是否使用与给定公钥相对应的私钥签名。
    void
    X509CRL.verify(PublicKey key, Provider sigProvider)
    验证此 CRL 是否使用与给定公钥相对应的私钥签名。
  • InvalidKeyExceptionjavax.crypto 中的用法

    修饰符和类型
    方法
    描述
    final Key
    KeyAgreement.doPhase(Key key, boolean lastPhase)
    参与此密钥协议的其他方之一收到的给定密钥执行此密钥协议的下一阶段。
    protected abstract Key
    KeyAgreementSpi.engineDoPhase(Key key, boolean lastPhase)
    参与此密钥协议的其他方之一收到的给定密钥执行此密钥协议的下一阶段。
    protected abstract SecretKey
    KeyAgreementSpi.engineGenerateSecret(String algorithm)
    创建共享机密并将其作为请求算法类型的密钥对象返回。
    protected int
    CipherSpi.engineGetKeySize(Key key)
    以位为单位返回给定密钥对象的密钥大小。
    protected abstract void
    CipherSpi.engineInit(int opmode, Key key, AlgorithmParameters params, SecureRandom random)
    使用密钥、一组算法参数和随机源初始化此 CipherSpi 对象。
    protected abstract void
    CipherSpi.engineInit(int opmode, Key key, SecureRandom random)
    使用密钥和随机源初始化此 CipherSpi 对象。
    protected abstract void
    CipherSpi.engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random)
    使用密钥、一组算法参数和随机源初始化此 CipherSpi 对象。
    protected abstract void
    ExemptionMechanismSpi.engineInit(Key key)
    使用密钥初始化此豁免机制。
    protected abstract void
    ExemptionMechanismSpi.engineInit(Key key, AlgorithmParameters params)
    使用密钥和一组算法参数初始化此豁免机制。
    protected abstract void
    ExemptionMechanismSpi.engineInit(Key key, AlgorithmParameterSpec params)
    使用密钥和一组算法参数初始化此豁免机制。
    protected abstract void
    KeyAgreementSpi.engineInit(Key key, SecureRandom random)
    使用给定的密钥和随机源初始化此密钥协议。
    protected abstract void
    KeyAgreementSpi.engineInit(Key key, AlgorithmParameterSpec params, SecureRandom random)
    使用给定的密钥、算法参数集和随机源初始化此密钥协议。
    protected abstract void
    MacSpi.engineInit(Key key, AlgorithmParameterSpec params)
    使用给定的(秘密)密钥和算法参数初始化 MAC。
    protected abstract SecretKey
    SecretKeyFactorySpi.engineTranslateKey(SecretKey key)
    将其提供者可能未知或可能不受信任的密钥对象转换为该密钥工厂的相应密钥对象。
    protected Key
    CipherSpi.engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType)
    打开先前包装的密钥。
    protected byte[]
    CipherSpi.engineWrap(Key key)
    包裹一把钥匙。
    final SecretKey
    KeyAgreement.generateSecret(String algorithm)
    创建共享机密并将其作为指定算法的 SecretKey 对象返回。
    EncryptedPrivateKeyInfo.getKeySpec(Key decryptKey)
    从加密数据中提取封闭的 PKCS8EncodedKeySpec 对象并将其返回。
    EncryptedPrivateKeyInfo.getKeySpec(Key decryptKey, String providerName)
    从加密数据中提取封闭的 PKCS8EncodedKeySpec 对象并将其返回。
    EncryptedPrivateKeyInfo.getKeySpec(Key decryptKey, Provider provider)
    从加密数据中提取封闭的 PKCS8EncodedKeySpec 对象并将其返回。
    final Object
    SealedObject.getObject(Key key)
    检索原始(封装的)对象。
    final Object
    SealedObject.getObject(Key key, String provider)
    检索原始(封装的)对象。
    final void
    Cipher.init(int opmode, Certificate certificate)
    使用给定证书中的公钥初始化此 Cipher 对象。
    final void
    Cipher.init(int opmode, Certificate certificate, SecureRandom random)
    使用来自给定证书的公钥和随机源初始化此 Cipher 对象。
    final void
    Cipher.init(int opmode, Key key)
    使用键初始化此 Cipher 对象。
    final void
    Cipher.init(int opmode, Key key, AlgorithmParameters params)
    使用密钥和一组算法参数初始化此 Cipher 对象。
    final void
    Cipher.init(int opmode, Key key, AlgorithmParameters params, SecureRandom random)
    使用密钥、一组算法参数和随机源初始化此 Cipher 对象。
    final void
    Cipher.init(int opmode, Key key, SecureRandom random)
    使用密钥和随机源初始化此 Cipher 对象。
    final void
    Cipher.init(int opmode, Key key, AlgorithmParameterSpec params)
    使用密钥和一组算法参数初始化此 Cipher 对象。
    final void
    Cipher.init(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random)
    使用密钥、一组算法参数和随机源初始化此 Cipher 对象。
    final void
    ExemptionMechanism.init(Key key)
    使用密钥初始化此豁免机制。
    final void
    ExemptionMechanism.init(Key key, AlgorithmParameters params)
    使用密钥和一组算法参数初始化此豁免机制。
    final void
    ExemptionMechanism.init(Key key, AlgorithmParameterSpec params)
    使用密钥和一组算法参数初始化此豁免机制。
    final void
    KeyAgreement.init(Key key)
    用给定的密钥初始化本次密钥协商,要求密钥中包含本次密钥协商所需的所有算法参数。
    final void
    KeyAgreement.init(Key key, SecureRandom random)
    使用给定的密钥和随机源初始化此密钥协议。
    final void
    KeyAgreement.init(Key key, AlgorithmParameterSpec params)
    使用给定的密钥和算法参数集初始化此密钥协议。
    final void
    KeyAgreement.init(Key key, AlgorithmParameterSpec params, SecureRandom random)
    使用给定的密钥、算法参数集和随机源初始化此密钥协议。
    final void
    Mac.init(Key key)
    使用给定的键初始化此 Mac 对象。
    final void
    Mac.init(Key key, AlgorithmParameterSpec params)
    使用给定的密钥和算法参数初始化此 Mac 对象。
    final SecretKey
    SecretKeyFactory.translateKey(SecretKey key)
    将其提供者可能未知或可能不受信任的密钥对象转换为该密钥工厂的相应密钥对象。
    final Key
    Cipher.unwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType)
    打开先前包装的密钥。
    final byte[]
    Cipher.wrap(Key key)
    包裹一把钥匙。
  • InvalidKeyExceptionjavax.crypto.spec 中的用法

    修饰符和类型
    方法
    描述
    static boolean
    DESedeKeySpec.isParityAdjusted(byte[] key, int offset)
    检查给定的 DES-EDE 密钥(从 offset 开始)是否经过奇偶校验调整。
    static boolean
    DESKeySpec.isParityAdjusted(byte[] key, int offset)
    检查给定的 DES 密钥材料(从 offset 开始)是否经过奇偶校验调整。
    static boolean
    DESKeySpec.isWeak(byte[] key, int offset)
    检查给定的 DES 密钥材料是否弱或半弱。
    javax.crypto.spec 中的构造函数抛出 InvalidKeyException
    修饰符
    构造方法
    描述
     
    DESedeKeySpec(byte[] key)
    使用 key 中的前 24 个字节作为 DES-EDE 密钥的密钥材料创建 DESedeKeySpec 对象。
     
    DESedeKeySpec(byte[] key, int offset)
    使用 key 中的前 24 个字节(从 offset 开始)创建一个 DESedeKeySpec 对象作为 DES-EDE 密钥的密钥材料。
     
    DESKeySpec(byte[] key)
    使用 key 中的前 8 个字节作为 DES 密钥的密钥材料创建 DESKeySpec 对象。
     
    DESKeySpec(byte[] key, int offset)
    使用 key 中的前 8 个字节(从 offset 开始)创建一个 DESKeySpec 对象作为 DES 密钥的密钥材料。
  • InvalidKeyExceptionjavax.security.cert 中的用法

    修饰符和类型
    方法
    描述
    abstract void
    Certificate.verify(PublicKey key)
    已弃用,将被删除:此 API 元素可能会在未来版本中删除。
    验证此证书是否使用与指定公钥相对应的私钥签名。
    abstract void
    Certificate.verify(PublicKey key, String sigProvider)
    已弃用,将被删除:此 API 元素可能会在未来版本中删除。
    验证此证书是否使用与指定公钥相对应的私钥签名。