public class KeyRep extends Object implements Serializable
请注意,序列化的密钥可能包含不应在不受信任的环境中暴露的敏感信息。 有关详细信息,请参阅序列化规范的Security Appendix。
Key
, KeyFactory
, SecretKeySpec
, X509EncodedKeySpec
, PKCS8EncodedKeySpec
, Serialized Form
Modifier and Type | Class and Description |
---|---|
static class |
KeyRep.Type
钥匙类型
|
Constructor and Description |
---|
KeyRep(KeyRep.Type type, String algorithm, String format, byte[] encoded)
构造备用Key类。
|
public KeyRep(KeyRep.Type type, String algorithm, String format, byte[] encoded)
type
- Type.SECRET,Type.PUBLIC或Type.PRIVATE
algorithm
- 从Key.getAlgorithm()返回的
Key.getAlgorithm()
format
- 从
Key.getFormat()
返回的编码格式
encoded
- 从
Key.getEncoded()
返回的编码字节
NullPointerException
- 如果类型是
null
,如果算法是
null
,如果格式是
null
,或者编码是
null
protected Object readResolve() throws ObjectStreamException
此方法支持三种类型/格式组合:
ObjectStreamException
- 如果
ObjectStreamException
类型/格式组合,如果算法,密钥格式或编码密钥字节无法识别/无效,则如果密钥的解析由于任何原因而失败
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.