Modifier and Type | Field and Description |
---|---|
protected SecureRandom |
appRandom
应用指定的随机源。
|
Constructor and Description |
---|
SignatureSpi() |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
返回一个克隆如果实现Cloneable。
|
protected abstract Object |
engineGetParameter(String param)
过时的。
|
protected AlgorithmParameters |
engineGetParameters()
重写此方法以提供者返回用这种签名引擎参数,或null如果签名引擎不使用任何参数。
|
protected abstract void |
engineInitSign(PrivateKey privateKey)
用指定的私钥签名操作初始化这个签名对象。
|
protected void |
engineInitSign(PrivateKey privateKey, SecureRandom random)
用指定的密钥和随机源签名操作初始化这个签名对象。
|
protected abstract void |
engineInitVerify(PublicKey publicKey)
用指定的公钥验证签名操作初始化这个对象。
|
protected void |
engineSetParameter(AlgorithmParameterSpec params)
重写此方法提供的初始化与指定的参数设置此签名引擎。
|
protected abstract void |
engineSetParameter(String param, Object value)
过时的。
取而代之的
engineSetParameter 。
|
protected abstract byte[] |
engineSign()
返回到已更新的所有数据的签名字节。
|
protected int |
engineSign(byte[] outbuf, int offset, int len)
完成这个签名操作和存储造成签名字节缓冲区的设置
outbuf ,开始在
offset 。
|
protected abstract void |
engineUpdate(byte b)
更新要使用指定的字节签名或验证的数据。
|
protected abstract void |
engineUpdate(byte[] b, int off, int len)
更新要签名或验证的数据,使用指定的字节数组,从指定的偏移量开始。
|
protected void |
engineUpdate(ByteBuffer input)
要签名的数据或使用指定验证更新ByteBuffer。
|
protected abstract boolean |
engineVerify(byte[] sigBytes)
验证签名中的通过。
|
protected boolean |
engineVerify(byte[] sigBytes, int offset, int length)
将在指定的字节数中指定的字节数组中的签名进行验证,从指定的偏移量开始。
|
protected SecureRandom appRandom
protected abstract void engineInitVerify(PublicKey publicKey) throws InvalidKeyException
publicKey
-身份的签名来验证公钥。
InvalidKeyException
-如果钥匙编码不正确,参数丢失,等等。
protected abstract void engineInitSign(PrivateKey privateKey) throws InvalidKeyException
privateKey
-身份的签名将生成的私钥。
InvalidKeyException
-如果钥匙编码不正确,参数丢失,等等。
protected void engineInitSign(PrivateKey privateKey, SecureRandom random) throws InvalidKeyException
这种具体方法已被添加到这个以前定义的抽象类。(对于向后兼容性,它不可能是抽象的。)
privateKey
-身份的签名将生成的私钥。
random
-随机源
InvalidKeyException
-如果钥匙编码不正确,参数丢失,等等。
protected abstract void engineUpdate(byte b) throws SignatureException
b
-字节用于更新。
SignatureException
-如果引擎初始化不正确。
protected abstract void engineUpdate(byte[] b, int off, int len) throws SignatureException
b
-字节数组
off
-偏移量开始从字节数组
len
-使用的字节数,起始偏移
SignatureException
-如果引擎初始化不正确
protected void engineUpdate(ByteBuffer input)
data.remaining()
字节开始在
data.position()
。当返回时,缓冲区的位置将等于它的极限,它的限制不会改变。
input
- ByteBuffer
protected abstract byte[] engineSign() throws SignatureException
SignatureException
-如果引擎初始化不正确或如果这签名算法无法处理输入数据的提供。
protected int engineSign(byte[] outbuf, int offset, int len) throws SignatureException
outbuf
,开始在
offset
。签名的格式取决于基础的签名方案。
签名实现重置为其初始状态(的状态是在打电话的一个engineInitSign
方法后)和可重复产生相同的签名私钥进一步。这种方法应该是抽象的,但我们留给它的具体的二进制兼容性。有知识的提供者应该重写此方法。
outbuf
-签名结果缓冲区。
offset
偏移到
outbuf
哪里签名存储。
len
-字节数在
outbuf
配发的签名。这个默认的实现和太阳提供者不回部分消化。如果此参数的值是小于实际的签名长度,该方法将抛出一个signatureexception。此参数将被忽略,如果它的值大于或等于实际签名长度。
outbuf
字节数
SignatureException
-如果引擎初始化不正确,如果这个签名算法无法处理提供输入数据,或者如果
len
小于实际签名长度。
protected abstract boolean engineVerify(byte[] sigBytes) throws SignatureException
sigBytes
-签名字节进行验证。
SignatureException
-如果引擎初始化不正确,通过签名编码不正确或错误的类型,如果这个签名算法无法处理提供输入数据,等等。
protected boolean engineVerify(byte[] sigBytes, int offset, int length) throws SignatureException
注:子类应覆盖默认实现。
sigBytes
-签名字节进行验证。
offset
-偏移量开始从字节数组。
length
-使用的字节数,起始偏移。
SignatureException
-如果引擎初始化不正确,通过签名编码不正确或错误的类型,如果这个签名算法无法处理提供输入数据,等等。
@Deprecated protected abstract void engineSetParameter(String param, Object value) throws InvalidParameterException
engineSetParameter
。
param
-参数标识符字符串。
value
-参数值。
InvalidParameterException
-如果
param
是这个签名算法引擎无效的参数,参数已经确定,不能再设置,发生安全异常,等等。
protected void engineSetParameter(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException
重写此方法提供的初始化与指定的参数设置此签名引擎。
params
-参数
UnsupportedOperationException
-如果这个方法不由提供程序重写
InvalidAlgorithmParameterException
-如果这方法是由一个供应商和给定的参数不合适,该签名引擎重写
protected AlgorithmParameters engineGetParameters()
重写此方法以提供者返回用这种签名引擎参数,或null如果签名引擎不使用任何参数。
返回的参数可能是相同的,用于初始化这个签名引擎,或可能包含默认和随机生成的参数值的组合使用的基础签名的实现,如果这个签名引擎需要算法参数,但没有初始化。
UnsupportedOperationException
-如果这个方法不由提供程序重写
@Deprecated protected abstract Object engineGetParameter(String param) throws InvalidParameterException
param
-参数的字符串名称。
InvalidParameterException
-如果
param
是这个发动机的参数无效,或另一个例外发生在试图让这个参数。
public Object clone() throws CloneNotSupportedException
clone
方法重写,继承类
Object
CloneNotSupportedException
-如果这是号召,不支持
Cloneable
实施。
Cloneable
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.