|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
SignatureCreator
and SignatureVerifier
.
See:
Description
Interface Summary | |
CertificateContent | KeyContent, that implements this interface contains certificate |
SignatureCreator | The interface of the object that is able to create XML Signature for a given source represented by a tokenizer. |
SignatureVerifier | The interface of the object that is able to verify signature represented by the tokenizer. |
Class Summary | |
KeyContent |
Class represents content of the KeyInfo element and together
with KeyContentFactory allows creating/verifying XML signature
with application defined KeyInfo element. |
KeyContentFactory |
The factory for KeyContent that creates the instance of the KeyContent
and (un)regiter the application defined KeyContent object. |
KeyValueContent | This is base class for all KeyContents, that lie under KeyValue
element. |
ReferencedData | Class for represent data referenced by Reference element. |
SignatureFactory | Class for creating SignatureCreator and SignatureVerifier instance. |
Transform | Class that provides transformation that may be used when signing. |
Exception Summary | |
SignatureException | Exception Class represents all exceptions thrown when an error occurs and provides the available message. |
This package enables creating and verifying XML Signature for a given data source via the
interfaces SignatureCreator
and SignatureVerifier
. Data-source and the being
created signature are represented by Tokenizer
.
Class SignatureFactory
is used to create the objects that implement SignatureCreator
and SignatureVerifier
interfaces.
When creating XML signature, some transformations may by applied on the data source. The class
Transform
provides the implemented transformations. It also enables application
to register and to use a application defined transformation.
XML Signature contains KeyInfo
element that provides information about public key
or certificate used to sign. The specification allows application defined structure of contain of
the KeyInfo
element. The classes KeyContentFactory
, KeyContent
and KeyValueContent
allow using implemented types of the KeyInfo
element
and also application defined KeyInfo
element.
Example of creating XML Signature:
Tokenizer dataSource; java.security.PrivateKey privateKey; java.security.PublicKey publicKey; ... /* set privateKey, publicKey and dataSource */ ... SignatureCreator creator = SignatureFactory.getInstance().getSignatureCreator(); Tokenizer sign = creator.createSignature(dataSource, privateKey, publicKey);
Example of verifying XML Signature:
Tokenizer sign; Tokenizer dataSource; ... /* sign and dataSource must be set here*/ ... boolean verified = SignatureFactory.getInstance().getSignatureVerifier().verify(sign, dataSource); if(verified){ System.out.println("OK, verifying signature passed"); } else{ System.out.println("ERR, verifying signature not passed!!!"); }
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |