wrappedKeyAlgorithm - 与此包装密钥关联的算法。
wrappedKeyType - 已包装密钥的类型。此类型必须为
SECRET_KEY、
PRIVATE_KEY 或
PUBLIC_KEY 之一。
返回: 解包的密钥。
抛出:
IllegalStateException - 如果此 Cipher 处于错误状态(例如,尚未初始化)
NoSuchAlgorithmException - 如果没有一个已安装的提供者能够针对
wrappedKeyAlgorithm 创建类型为
wrappedKeyType 的密钥。
InvalidKeyException - 如果
wrappedKey 不表示针对
wrappedKeyAlgorithm 的类型为
wrappedKeyType 的已包装密钥。
33、public static final int getMaxAllowedKeyLength(String transformation) throws NoSuchAlgorithmException 根据所安装的 JCE 仲裁策略文件,返回指定转换的最大密钥长度。如果安装了 JCE 无限制强度仲裁策略文件,则返回 Integer.MAX_VALUE
参数:transformation - Cipher 转换。
返回: 最大密钥长度(以位为单位) 或 Integer.MAX_VALUE。
抛出:
NullPointerException - 如果
transformation 为 null。
NoSuchAlgorithmException - 如果
transformation 不是有效的转换,即格式不为“算法”或“算法/模式/填充”。
34、public static final AlgorithmParameterSpec getMaxAllowedParameterSpec(String transformation) throws NoSuchAlgorithmException
根据仲裁策略文件,返回包含最大 Cipher 参数值的 AlgorithmParameterSpec 对象。如果安装了 JCE 无限制强度仲裁策略文件,或者策略文件中对用于指定转换的参数没有最大限制,则返回 null。参数: transformation - Cipher 转换。 返回: 保存最大值的 AlgorithmParameterSpec,或者返回 null。
NullPointerException - 如果
transformation 为 null。
NoSuchAlgorithmException - 如果
transformation 不是有效的转换,即格式不为“算法”或“算法/模式/填充”。