Bouncy Castle Cryptography Library 1.85

org.bouncycastle.jcajce.provider.asymmetric.edec
Class SignatureSpi

java.lang.Object
  extended byjava.security.SignatureSpi
      extended byorg.bouncycastle.jcajce.provider.asymmetric.edec.SignatureSpi
Direct Known Subclasses:
SignatureSpi.Ed25519, SignatureSpi.Ed448, SignatureSpi.EdDSA

public class SignatureSpi
extends java.security.SignatureSpi


Nested Class Summary
static class SignatureSpi.Ed25519
           
static class SignatureSpi.Ed448
           
static class SignatureSpi.EdDSA
           
 
Field Summary
protected  byte[] context
           
protected  boolean parametersSet
           
protected  boolean prehash
           
 
Fields inherited from class java.security.SignatureSpi
appRandom
 
Method Summary
protected  void applyParams(boolean prehash, byte[] context)
          Apply the RFC 8032 instance selectors.
protected  void checkCurve(java.lang.String curveName)
          When the spec names a curve, reject it if it cannot match a single-algorithm SPI (the per-curve Ed25519 / Ed448 SignatureSpi subclasses).
protected  java.lang.Object engineGetParameter(java.lang.String s)
           
protected  java.security.AlgorithmParameters engineGetParameters()
           
protected  void engineInitSign(java.security.PrivateKey privateKey)
           
protected  void engineInitVerify(java.security.PublicKey publicKey)
           
protected  void engineSetParameter(java.security.spec.AlgorithmParameterSpec params)
           
protected  void engineSetParameter(java.lang.String s, java.lang.Object o)
           
protected  byte[] engineSign()
           
protected  void engineUpdate(byte b)
           
protected  void engineUpdate(byte[] bytes, int off, int len)
           
protected  boolean engineVerify(byte[] signature)
           
 
Methods inherited from class java.security.SignatureSpi
clone, engineInitSign, engineSign, engineVerify
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prehash

protected boolean prehash

context

protected byte[] context

parametersSet

protected boolean parametersSet
Method Detail

engineInitVerify

protected void engineInitVerify(java.security.PublicKey publicKey)
                         throws java.security.InvalidKeyException
Throws:
java.security.InvalidKeyException

engineInitSign

protected void engineInitSign(java.security.PrivateKey privateKey)
                       throws java.security.InvalidKeyException
Throws:
java.security.InvalidKeyException

engineUpdate

protected void engineUpdate(byte b)
                     throws java.security.SignatureException
Throws:
java.security.SignatureException

engineUpdate

protected void engineUpdate(byte[] bytes,
                            int off,
                            int len)
                     throws java.security.SignatureException
Throws:
java.security.SignatureException

engineSign

protected byte[] engineSign()
                     throws java.security.SignatureException
Throws:
java.security.SignatureException

engineVerify

protected boolean engineVerify(byte[] signature)
                        throws java.security.SignatureException
Throws:
java.security.SignatureException

engineSetParameter

protected void engineSetParameter(java.security.spec.AlgorithmParameterSpec params)
                           throws java.security.InvalidAlgorithmParameterException
Throws:
java.security.InvalidAlgorithmParameterException

applyParams

protected final void applyParams(boolean prehash,
                                 byte[] context)
                          throws java.security.InvalidAlgorithmParameterException
Apply the RFC 8032 instance selectors. Parameters must be set before initSign / initVerify (the signer that consumes them is built at init time), matching the SunEC EdDSA behaviour.

Throws:
java.security.InvalidAlgorithmParameterException

checkCurve

protected final void checkCurve(java.lang.String curveName)
                         throws java.security.InvalidAlgorithmParameterException
When the spec names a curve, reject it if it cannot match a single-algorithm SPI (the per-curve Ed25519 / Ed448 SignatureSpi subclasses). The generic EdDSA SPI (algorithm == null) defers the curve to the key.

Throws:
java.security.InvalidAlgorithmParameterException

engineSetParameter

protected void engineSetParameter(java.lang.String s,
                                  java.lang.Object o)
                           throws java.security.InvalidParameterException
Throws:
java.security.InvalidParameterException

engineGetParameter

protected java.lang.Object engineGetParameter(java.lang.String s)
                                       throws java.security.InvalidParameterException
Throws:
java.security.InvalidParameterException

engineGetParameters

protected java.security.AlgorithmParameters engineGetParameters()

Bouncy Castle Cryptography Library 1.85