public abstract class EncodedKeySpec
extends Object implements KeySpec
| java.lang.Object | |
| java.security.spec.EncodedKeySpec | |
| |
该类表示编码格式的公钥或私钥。
Public constructors |
|
|---|---|
EncodedKeySpec(byte[] encodedKey) 使用给定的编码密钥创建新的EncodedKeySpec。 |
|
公共方法(Public methods) |
|
|---|---|
byte[] |
getEncoded() 返回编码密钥。 |
abstract String |
getFormat() 返回与此密钥规范关联的编码格式的名称。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
EncodedKeySpec (byte[] encodedKey)
使用给定的编码密钥创建新的EncodedKeySpec。
| 参数(Parameters) | |
|---|---|
encodedKey |
byte: the encoded key. The contents of the array are copied to protect against subsequent modification. |
| 抛出异常(Throws) | |
|---|---|
NullPointerException |
if encodedKey is null. |
byte[] getEncoded ()
返回编码密钥。
| 返回(Returns) | |
|---|---|
byte[] |
the encoded key. Returns a new array each time this method is called. |
String getFormat ()
返回与此密钥规范关联的编码格式的名称。
如果密钥的不透明表示(见 Key )可以转换(参见 KeyFactory )到此密钥规范(或其子类)中, getFormat在不透明密钥上调用的 getFormat将返回与此密钥规范的 getFormat方法相同的值。
| 返回(Returns) | |
|---|---|
String |
a string representation of the encoding format. |