public interface Key extends Serializable
这是该键的关键算法。关键算法通常是加密或不对称运行的算法(如DSA和RSA),将这些算法和相关算法(如MD5和SHA-1 RSA,RSA,DSA等原料,)中的一个关键算法的名称是使用getAlgorithm
方法得到的。
这是一个外部的编码形式的关键时使用的标准表示的关键是在java虚拟机需要在发送到其他一些党的关键。关键是按照一个标准的编码格式(如X.509 SubjectPublicKeyInfo
或PKCS # 8),并返回使用getEncoded
方法。注:对1型SubjectPublicKeyInfo
ASN.1语法定义如下:
subjectpublickeyinfo::=序列{算法algorithmidentifier,subjectpublickey比特串}algorithmidentifier::=序列{算法对象标识符,参数定义的算法可选}更多信息,看到RFC 3280: Internet X.509 Public Key Infrastructure Certificate and CRL Profile。
这是编码的键的格式的名称。它是由getFormat
方法返回。
KeyFactory
)。
关键要用keyrep为序列化表示。注意,一个序列化的关键可能包含不应在不受信任的环境中暴露敏感信息。看到 Security Appendix序列化规范的更多信息。
PublicKey
,
PrivateKey
,
KeyPair
,
KeyPairGenerator
,
KeyFactory
,
KeyRep
,
KeySpec
,
Identity
,
Signer
Modifier and Type | Field and Description |
---|---|
static long |
serialVersionUID
设置为表示与类的前一个版本的序列化兼容性的类的指纹。
|
Modifier and Type | Method and Description |
---|---|
String |
getAlgorithm()
返回此键的标准算法名称。
|
byte[] |
getEncoded()
返回其主编码格式的键,如果此键不支持编码,或为空。
|
String |
getFormat()
返回此键的主编码格式的名称,如果此键不支持编码,或为空。
|
static final long serialVersionUID
String getAlgorithm()
String getFormat()
"X.509"
。同样,ASN的名称。1私人密钥数据格式privatekeyinfo,定义由# PKCS 8标准;在这种情况下,返回的格式是
"PKCS#8"
。
byte[] getEncoded()
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.