|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--spki.BaseObj
|
+--spki.Signature
SPKI Signature class.
Formal definition:
<hash-of-obj>:: <hash> ;
<signer>:: <principal> ;
<sig-params>:: <byte-string> | <s-expr>+ ;
<sig-val>:: "(" <pub-sig-alg-id> <sig-params> ")" ;
<signature>:: "(" "signature" <hash-of-obj> <signer> <sig-val> ")" ;
Currently, only those signature-schemes provided by Cryptix and Sun JDK-1.2 are suppored. Actual support is dependent on the implementation of PrivateKey and PublicKey classes: for now it's rsa-pkcs1-sha1.
TODO: Support <s-expr> as <sig-params>.
Hash,
Principal,
PublicKey,
PrivateKey| Field Summary | |
private static String |
__ME
This class's full name. |
private Hash |
hash
Hash of the object signed. |
private Principal |
principal
Verifying principal. |
static String |
SEXP_NAME
This class S-Expression type name, used by toSExpression() and other methods. |
private String |
sig_alg_id
Signature algorithm id used. |
private byte[] |
sig_params
Signature value. |
| Fields inherited from class spki.BaseObj |
__ME,
cache_sexp,
cached_sexp,
DEFAULT_HASH_ALG,
locked,
SEXP_NAME |
| Constructor Summary | |
protected |
Signature()
Don't use me! |
|
Signature(Hash hash,
Principal principal,
String alg_id,
byte[] sig_params)
Create an immutable Signature object from pre-fab signature parameters. |
|
Signature(SExpression sexp)
Create an immutable Signature object from an S-Expression. |
| Method Summary | |
boolean |
equals(Signature that)
Compare this object against the given object. |
String |
getAlgId()
Get the signature algorithm ID. |
Hash |
getObjHash()
Get the hash of the signed object. |
Principal |
getPrincipal()
Get the verifying principal. |
byte[] |
getSigParams()
Get the signature value. |
SExpression |
toSExpression()
Build an SExpression representing this object. |
| Methods inherited from class spki.BaseObj |
disableSExpressionCaching,
enableSExpressionCaching,
extractHashAlgId,
getCachedSExpression,
isLocked,
isSListOfType,
lock,
providerToSPKI,
setCachedSExpression,
spkiToProvider,
toString |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private static final String __ME
public static final String SEXP_NAME
toSExpression()private Hash hash
private Principal principal
private String sig_alg_id
private byte[] sig_params
| Constructor Detail |
protected Signature()
Signature(SExpression),
Signature(spki.Hash,spki.interfaces.Principal,String,byte[])
public Signature(SExpression sexp)
throws SPKIException,
ParseException
BaseObj.BaseObj(SExpression)
public Signature(Hash hash,
Principal principal,
String alg_id,
byte[] sig_params)
throws SPKIException
hash - the Hash of the object being signed.principal - the verifying principal, may hold a full public key
or just a has of the public key.alg_id - the signature algorithm ID, ignored if
the given principal already holds a full public key.sig_params - the signature value.| Method Detail |
public SExpression toSExpression()
throws SPKIException
public Hash getObjHash()
public Principal getPrincipal()
public String getAlgId()
public byte[] getSigParams()
public boolean equals(Signature that)
that - the Signature object to compare this object against.Hash.equals(Hash),
Principal.equals(spki.interfaces.Principal)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||