|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jsdsi.Obj jsdsi.Signature
A cryptographic signature.
Nested Class Summary |
Nested classes inherited from class jsdsi.Element |
Element.Default |
Field Summary |
Fields inherited from class jsdsi.Obj |
_obj |
Constructor Summary | |
Signature(Principal i,
Hash h,
SignatureAlgoEnum a,
byte[] d)
Creates a new Signature. |
|
Signature(Principal i,
Hash h,
java.lang.String a,
byte[] d)
Deprecated. use Signature(Principal, Hash, jsdsi.util.SignatureAlgoEnum, byte[] |
Method Summary | |
static Signature |
create(java.security.KeyPair kp,
byte[] bytes,
DigestAlgoEnum a)
Signs the given byte array using the 'default' java.security.Provider. |
static Signature |
create(java.security.KeyPair kp,
byte[] bytes,
DigestAlgoEnum a,
java.lang.String provider)
Signs the given byte array using the specified java.security.Provider. |
static Signature |
create(java.security.KeyPair kp,
byte[] b,
java.lang.String a)
Deprecated. |
static Signature |
create(java.security.KeyPair kp,
byte[] b,
java.lang.String a,
java.lang.String provider)
Deprecated. |
static Signature |
create(java.security.KeyPair kp,
java.io.InputStream is,
DigestAlgoEnum a)
Signs the given byte array using the 'default' java.security.Provider. |
static Signature |
create(java.security.KeyPair kp,
java.io.InputStream is,
DigestAlgoEnum digestEnum,
java.lang.String provider)
Signs the given byte array using the specified java.security.Provider. |
static Signature |
create(java.security.KeyPair kp,
java.io.InputStream toSign,
java.lang.String a)
Deprecated. |
static Signature |
create(java.security.KeyPair kp,
java.io.InputStream toSign,
java.lang.String a,
java.lang.String provider)
Deprecated. |
static Signature |
create(java.security.KeyPair kp,
Obj o,
DigestAlgoEnum a)
Signs the given JSDSI Obj using the 'default' java.security.Provider. |
static Signature |
create(java.security.KeyPair kp,
Obj o,
DigestAlgoEnum a,
java.lang.String provider)
Signs the given JSDSI Obj using the specified java.security.Provider. |
static Signature |
create(java.security.KeyPair kp,
Obj o,
java.lang.String a)
Deprecated. |
static Signature |
create(java.security.KeyPair kp,
Obj o,
java.lang.String a,
java.lang.String provider)
Deprecated. |
boolean |
equals(java.lang.Object o)
|
java.lang.String |
getAlgorithm()
|
byte[] |
getData()
|
SignatureAlgoEnum |
getSignatureEnum()
|
Hash |
getSignee()
|
Principal |
getSigner()
|
int |
hashCode()
|
static void |
main(java.lang.String[] args)
|
SexpList |
toSexp()
Creates an SexpList -representation from this SDSI-object. |
boolean |
verify(java.security.PublicKey key,
byte[] b)
|
boolean |
verify(java.security.PublicKey key,
byte[] b,
java.lang.String provider)
|
boolean |
verify(java.security.PublicKey key,
java.io.InputStream toCheck)
|
boolean |
verify(java.security.PublicKey key,
java.io.InputStream toCheck,
java.lang.String provider)
Using the provider , verifies that the corresponding
PrivateKey for key generated this
Signature for the data given by toCheck |
boolean |
verify(java.security.PublicKey key,
Obj o)
Using the default security Provider, verifies that the corresponding PrivateKey for key generated
this Signature for o |
boolean |
verify(java.security.PublicKey key,
Obj o,
java.lang.String provider)
|
Methods inherited from class jsdsi.Obj |
parseObj, parseObj, readResolve, toByteArray, toString, toString, toTransport |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Signature(Principal i, Hash h, SignatureAlgoEnum a, byte[] d)
i
- the signerh
- hash of the signed dataa
- signature algorithmd
- signature value (not the data to sign)public Signature(Principal i, Hash h, java.lang.String a, byte[] d)
Signature(Principal, Hash, jsdsi.util.SignatureAlgoEnum, byte[]
i
- the signerh
- hash of the signed dataa
- signature algorithmd
- signature value (not the data to sign)Method Detail |
public static Signature create(java.security.KeyPair kp, Obj o, DigestAlgoEnum a)
kp
- KeyPair containing the PrivateKey to sign with.o
- JSDSI Obj to sign.a
- hash algorythm to use.
JsdsiRuntimeException
- on errorpublic static Signature create(java.security.KeyPair kp, byte[] bytes, DigestAlgoEnum a)
kp
- KeyPair containing the PrivateKey to sign with.bytes
- data to sign.a
- hash algorythm to use.
JsdsiRuntimeException
- on errorpublic static Signature create(java.security.KeyPair kp, java.io.InputStream is, DigestAlgoEnum a)
kp
- KeyPair containing the PrivateKey to sign with.is
- data to sign.a
- hash algorythm to use.
JsdsiRuntimeException
- on errorpublic static Signature create(java.security.KeyPair kp, Obj o, DigestAlgoEnum a, java.lang.String provider)
kp
- KeyPair containing the PrivateKey to sign with.o
- JSDSI Obj to sign.a
- hash algorythm to use.
JsdsiRuntimeException
- on errorpublic static Signature create(java.security.KeyPair kp, byte[] bytes, DigestAlgoEnum a, java.lang.String provider)
kp
- KeyPair containing the PrivateKey to sign with.bytes
- data to sign.a
- hash algorythm to use.
JsdsiRuntimeException
- on errorpublic static Signature create(java.security.KeyPair kp, java.io.InputStream is, DigestAlgoEnum digestEnum, java.lang.String provider)
kp
- KeyPair containing the PrivateKey to sign with.is
- data to sign.digestEnum
- hash algorythm to use.
JsdsiRuntimeException
- on errorpublic static Signature create(java.security.KeyPair kp, Obj o, java.lang.String a) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.NoSuchProviderException, java.security.SignatureException
kp
- the KeyPair containing the PrivateKey to sign with.o
- the JSDSI Obj to sign.a
- the name of the signing algorythm to use.
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.security.NoSuchProviderException
java.security.SignatureException
public static Signature create(java.security.KeyPair kp, Obj o, java.lang.String a, java.lang.String provider) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.NoSuchProviderException, java.security.SignatureException
kp
- the KeyPair containing the PrivateKey to sign with.o
- the JSDSI Obj to sign.a
- the name of the signing algorythm to use.provider
- the name of the security Provider to use.
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.security.NoSuchProviderException
java.security.SignatureException
public static Signature create(java.security.KeyPair kp, byte[] b, java.lang.String a) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.NoSuchProviderException, java.security.SignatureException
byte[]
using the
'default' java.security.Provider.
kp
- the KeyPair containing the PrivateKey to sign with.b
- the data to sign.a
- the name of the signing algorythm to use.
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.security.NoSuchProviderException
java.security.SignatureException
public static Signature create(java.security.KeyPair kp, byte[] b, java.lang.String a, java.lang.String provider) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.NoSuchProviderException, java.security.SignatureException
byte[]
.
kp
- the KeyPair containing the PrivateKey to sign with.b
- the data to sign.a
- the name of the signing algorythm to use.provider
- the name of the security Provider to use.
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.security.NoSuchProviderException
java.security.SignatureException
public static Signature create(java.security.KeyPair kp, java.io.InputStream toSign, java.lang.String a) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException
java.io.InputStream
using the 'default' java.security.Provider.
kp
- the KeyPair containing the PrivateKey to sign with.toSign
- the InputStream with the data to sign.a
- the name of the signing algorythm to use.
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.security.NoSuchProviderException
java.security.SignatureException
public static Signature create(java.security.KeyPair kp, java.io.InputStream toSign, java.lang.String a, java.lang.String provider) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.InvalidKeyException, java.security.SignatureException
java.io.InputStream
.
kp
- the KeyPair containing the PrivateKey to sign with.toSign
- the InputStream with the data to sign.a
- the name of the signing algorythm to useprovider
- the name of the security Provider to use.
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.security.NoSuchProviderException
java.security.SignatureException
public boolean verify(java.security.PublicKey key, Obj o) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException
key
generated
this
Signature for o
key
- the PublicKeyo
- the jsdsi object that was (alledgedly) signed
true
if the signature verifies
JsdsiRuntimeException
- on error
java.security.InvalidKeyException
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.SignatureException
public boolean verify(java.security.PublicKey key, Obj o, java.lang.String provider) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException
java.security.InvalidKeyException
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.SignatureException
public boolean verify(java.security.PublicKey key, byte[] b) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException
java.security.InvalidKeyException
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.SignatureException
public boolean verify(java.security.PublicKey key, byte[] b, java.lang.String provider) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException
java.security.InvalidKeyException
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.SignatureException
public boolean verify(java.security.PublicKey key, java.io.InputStream toCheck) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException
java.security.InvalidKeyException
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.SignatureException
public boolean verify(java.security.PublicKey key, java.io.InputStream toCheck, java.lang.String provider) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.InvalidKeyException, java.security.SignatureException
provider
, verifies that the corresponding
PrivateKey for key
generated this
Signature for the data given by toCheck
key
- the PublicKeytoCheck
- an InputStream of data
true
if the signature verifies
JsdsiRuntimeException
- on error
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.InvalidKeyException
java.security.SignatureException
public Principal getSigner()
public Hash getSignee()
public java.lang.String getAlgorithm()
public SignatureAlgoEnum getSignatureEnum()
public byte[] getData()
public boolean equals(java.lang.Object o)
equals
in class Obj
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Obj
Object.hashCode()
public SexpList toSexp()
Obj
SexpList
-representation from this SDSI-object.
toSexp
in interface Element
toSexp
in class Obj
SexpList
that represents this SDSI-object.public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |