Most visited

Recently visited

Added in API level 1

EncodedKeySpec

public abstract class EncodedKeySpec
extends Object implements KeySpec

java.lang.Object
    java.security.spec.EncodedKeySpec
Known Direct Subclasses


该类表示编码格式的公钥或私钥。

也可以看看:

摘要(Summary)

Public constructors

EncodedKeySpec(byte[] encodedKey)

使用给定的编码密钥创建新的EncodedKeySpec。

公共方法(Public methods)

byte[] getEncoded()

返回编码密钥。

abstract String getFormat()

返回与此密钥规范关联的编码格式的名称。

继承方法(Inherited methods)

From class java.lang.Object

Public constructors

EncodedKeySpec

Added in API level 1
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.

公共方法(Public methods)

getEncoded

Added in API level 1
byte[] getEncoded ()

返回编码密钥。

返回(Returns)
byte[] the encoded key. Returns a new array each time this method is called.

getFormat

Added in API level 1
String getFormat ()

返回与此密钥规范关联的编码格式的名称。

如果密钥的不透明表示(见 Key )可以转换(参见 KeyFactory )到此密钥规范(或其子类)中, getFormat在不透明密钥上调用的 getFormat将返回与此密钥规范的 getFormat方法相同的值。

返回(Returns)
String a string representation of the encoding format.

Hooray!