JavaTM 2 Platform
Standard Ed. 6

类 java.security.InvalidKeyException
的使用

使用 InvalidKeyException 的软件包
java.security 为安全框架提供类和接口。 
java.security.cert 提供用于解析和管理证书、证书撤消列表 (CRL) 和证书路径的类和接口。 
javax.crypto 为加密操作提供类和接口。 
javax.crypto.spec 为密钥规范和算法参数规范提供类和接口。 
javax.security.cert 为公钥证书提供类。 
 

java.securityInvalidKeyException 的使用
 

抛出 InvalidKeyExceptionjava.security 中的方法
protected abstract  void SignatureSpi.engineInitSign(PrivateKey privateKey)
          通过用于签名操作的指定私钥初始化此签名对象。
protected  void SignatureSpi.engineInitSign(PrivateKey privateKey, SecureRandom random)
          通过用于签名操作的指定私钥和随机源初始化此签名对象。
protected abstract  void SignatureSpi.engineInitVerify(PublicKey publicKey)
          通过用于验证操作的指定公钥初始化此签名对象。
protected abstract  Key KeyFactorySpi.engineTranslateKey(Key key)
          将其 provider 可能是未知的或可能不受信任的密钥对象转换成此密钥工厂的相应密钥对象。
 void Signature.initSign(PrivateKey privateKey)
          初始化这个用于签名的对象。
 void Signature.initSign(PrivateKey privateKey, SecureRandom random)
          初始化这个用于签名的对象。
 void Signature.initVerify(Certificate certificate)
          使用来自给定证书的公钥初始化此用于验证的对象。
 void Signature.initVerify(PublicKey publicKey)
          初始化此用于验证的对象。
 Key KeyFactory.translateKey(Key key)
          将提供者可能未知或不受信任的密钥对象转换成此密钥工厂对应的密钥对象。
 boolean SignedObject.verify(PublicKey verificationKey, Signature verificationEngine)
          使用指派的验证引擎,通过给定的验证密钥验证此 SignedObject 中的签名是否为内部存储对象的有效签名。
 

抛出 InvalidKeyExceptionjava.security 中的构造方法
SignedObject(Serializable object, PrivateKey signingKey, Signature signingEngine)
          通过任何可序列化对象构造 SignedObject。
 

java.security.certInvalidKeyException 的使用
 

抛出 InvalidKeyExceptionjava.security.cert 中的方法
abstract  void X509CRL.verify(PublicKey key)
          验证是否已使用与给定公钥相应的私钥签署了此 CRL。
abstract  void Certificate.verify(PublicKey key)
          验证是否已使用与指定公钥相应的私钥签署了此证书。
abstract  void X509CRL.verify(PublicKey key, String sigProvider)
          验证是否已使用与给定公钥相应的私钥签署了此 CRL。
abstract  void Certificate.verify(PublicKey key, String sigProvider)
          验证是否已使用与指定公钥相应的私钥签署了此证书。
 

javax.cryptoInvalidKeyException 的使用
 

抛出 InvalidKeyExceptionjavax.crypto 中的方法
 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, AlgorithmParameterSpec params, SecureRandom random)
          用一个密钥、一组算法参数和一个随机源初始化此 cipher。
protected abstract  void CipherSpi.engineInit(int opmode, Key key, AlgorithmParameters params, SecureRandom random)
          用一个密钥、一组算法参数和一个随机源初始化此 cipher。
protected abstract  void CipherSpi.engineInit(int opmode, Key key, SecureRandom random)
          用密钥和随机源初始化此 cipher。
protected abstract  void ExemptionMechanismSpi.engineInit(Key key)
          用密钥初始化此豁免机制。
protected abstract  void ExemptionMechanismSpi.engineInit(Key key, AlgorithmParameters params)
          用一个密钥和一组算法参数初始化此豁免机制。
protected abstract  void MacSpi.engineInit(Key key, AlgorithmParameterSpec params)
          用给定的(秘密)密钥和算法参数初始化 MAC。
protected abstract  void ExemptionMechanismSpi.engineInit(Key key, AlgorithmParameterSpec params)
          用一个密钥和一组算法参数初始化此豁免机制。
protected abstract  void KeyAgreementSpi.engineInit(Key key, AlgorithmParameterSpec params, SecureRandom random)
          用给定密钥、算法参数集和随机源初始化此密钥协定。
protected abstract  void KeyAgreementSpi.engineInit(Key key, SecureRandom random)
          用给定密钥和随机源初始化此密钥协定。
protected abstract  SecretKey SecretKeyFactorySpi.engineTranslateKey(SecretKey key)
          将一个密钥对象(其提供者未知或可能不受信任)转换为此密钥工厂的相应密钥对象。
protected  Key CipherSpi.engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType)
          打开一个以前包装的密钥。
protected  byte[] CipherSpi.engineWrap(Key key)
          将密钥包装。
 SecretKey KeyAgreement.generateSecret(String algorithm)
          创建共享秘密并将其作为指定算法的 SecretKey 对象返回。
 PKCS8EncodedKeySpec EncryptedPrivateKeyInfo.getKeySpec(Key decryptKey)
          将密封的 PKCS8EncodedKeySpec 对象从加密的数据中抽取出来并将其返回。
 PKCS8EncodedKeySpec EncryptedPrivateKeyInfo.getKeySpec(Key decryptKey, Provider provider)
          将密封的 PKCS8EncodedKeySpec 对象从加密的数据中抽取出来并将其返回。
 PKCS8EncodedKeySpec EncryptedPrivateKeyInfo.getKeySpec(Key decryptKey, String providerName)
          将密封的 PKCS8EncodedKeySpec 对象从加密的数据中抽取出来并将其返回。
 Object SealedObject.getObject(Key key)
          获取原始(封装的)对象。
 Object SealedObject.getObject(Key key, String provider)
          获取原始(封装的)对象。
 void Cipher.init(int opmode, Certificate certificate)
          用取自给定证书的公钥初始化此 Cipher。
 void Cipher.init(int opmode, Certificate certificate, SecureRandom random)
          用取自给定证书的公钥和随机源初始化此 Cipher。
 void Cipher.init(int opmode, Key key)
          用密钥初始化此 Cipher。
 void Cipher.init(int opmode, Key key, AlgorithmParameters params)
          用密钥和一组算法参数初始化此 Cipher。
 void Cipher.init(int opmode, Key key, AlgorithmParameterSpec params)
          用密钥和一组算法参数初始化此 Cipher。
 void Cipher.init(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random)
          用一个密钥、一组算法参数和一个随机源初始化此 Cipher。
 void Cipher.init(int opmode, Key key, AlgorithmParameters params, SecureRandom random)
          用一个密钥、一组算法参数和一个随机源初始化此 Cipher。
 void Cipher.init(int opmode, Key key, SecureRandom random)
          用密钥和随机源初始化此 Cipher。
 void ExemptionMechanism.init(Key key)
          用密钥初始化此豁免机制。
 void KeyAgreement.init(Key key)
          用给定密钥初始化此密钥协定,给定密钥需要包含此密钥协定所需的所有算法参数。
 void Mac.init(Key key)
          用给定的密钥初始化此 Mac 对象。
 void ExemptionMechanism.init(Key key, AlgorithmParameters params)
          用一个密钥和一组算法参数初始化此豁免机制。
 void ExemptionMechanism.init(Key key, AlgorithmParameterSpec params)
          用一个密钥和一组算法参数初始化此豁免机制。
 void KeyAgreement.init(Key key, AlgorithmParameterSpec params)
          用给定密钥和算法参数集初始化此密钥协定。
 void Mac.init(Key key, AlgorithmParameterSpec params)
          用给定的密钥和算法参数初始化此 Mac 对象。
 void KeyAgreement.init(Key key, AlgorithmParameterSpec params, SecureRandom random)
          用给定密钥、算法参数集和随机源初始化此密钥协定。
 void KeyAgreement.init(Key key, SecureRandom random)
          用给定密钥和随机源初始化此密钥协议。
 SecretKey SecretKeyFactory.translateKey(SecretKey key)
          将一个密钥对象(其提供者未知或可能不受信任)转换为此秘密密钥工厂的相应密钥对象。
 Key Cipher.unwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType)
          解包一个以前包装的密钥。
 byte[] Cipher.wrap(Key key)
          包装密钥。
 

javax.crypto.specInvalidKeyException 的使用
 

抛出 InvalidKeyExceptionjavax.crypto.spec 中的方法
static boolean DESKeySpec.isParityAdjusted(byte[] key, int offset)
          确定给定的始于且包含 offset 的 DES 密钥内容是否是奇偶校验的 (parity-adjusted)。
static boolean DESedeKeySpec.isParityAdjusted(byte[] key, int offset)
          确定给定的始于且包含 offset 的 DES-EDE 密钥是否是奇偶校验的 (parity-adjusted)。
static boolean DESKeySpec.isWeak(byte[] key, int offset)
          确定给定的 DES 密钥内容是否是全弱或者半弱的。
 

抛出 InvalidKeyExceptionjavax.crypto.spec 中的构造方法
DESedeKeySpec(byte[] key)
          创建一个 DESedeKeySpec 对象,使用 key 中的前 24 个字节作为 DES-EDE 密钥的密钥内容。
DESedeKeySpec(byte[] key, int offset)
          创建一个 DESedeKeySpec 对象,使用 key 中始于且包含 offset 的前 24 个字节作为 DES-EDE 密钥的密钥内容。
DESKeySpec(byte[] key)
          创建一个 DESKeySpec 对象,使用 key 中的前 8 个字节作为 DES 密钥的密钥内容。
DESKeySpec(byte[] key, int offset)
          创建一个 DESKeySpec 对象,使用 key 中始于且包含 offset 的前 8 个字节作为 DES-EDE 密钥的密钥内容。
 

javax.security.certInvalidKeyException 的使用
 

抛出 InvalidKeyExceptionjavax.security.cert 中的方法
abstract  void Certificate.verify(PublicKey key)
          验证是否已使用与指定公钥相对应的私钥签署了此证书。
abstract  void Certificate.verify(PublicKey key, String sigProvider)
          验证是否已使用与指定公钥相对应的私钥签署了此证书。
 


JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only