| Modifier and Type | Field and Description | 
|---|---|
| protected SecureRandom | appRandom
              应用指定的随机源。 
             | 
| Constructor and Description | 
|---|
| SignatureSpi() | 
| Modifier and Type | Method and Description | 
|---|---|
| Object | clone()
              如果实现是可克隆的,则返回克隆。 
             | 
| 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 - 
            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分配给签名。 
            这个默认实现和SUN提供者都不返回部分摘要。 
            如果此参数的值小于实际签名长度,则此方法将抛出一个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.