|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.idoox.xml.security.Transform
Class that provides transformation that may be used when signing. All
transformation classes must be derived from this base class and override the
method transform(byte[] input)
. There are two implemented transforms:
c14n
with
name="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
exclusive c14n
with
name="http://www.w3.org/2001/10/xml-exc-c14n#"
base64
with
name="http://www.w3.org/2000/09/xmldsig#base64"
.
enveloped signature
with
name="http://www.w3.org/2000/09/xmldsig#enveloped-signature"
.
Example of using the implemented transform when creating signature:
SignatureCreator sc = SignatureFactory.getInstance().getSignatureCreator(); sc.addTransformAlgorithm("http://www.w3.org/2000/09/xmldsig#base64"); ... sc.createSignature(...);
Application may implement the further transformation class derived from
this base class and plug it into the WSO2 SOA Enablement Server using: addTransform
method
as in the example follows.
public class MyTransform extends Transform{ public MyTransform(){ super("DummyTransform"); } public byte[] transform(byte[] input) throws SignatureException{ byte output[]; ... // transform input to output ... return output; } } ... //register MyTransform Transform.addTransform("DummyTransform", new MyTransform()); ... // using it when creating signature SignatureCreator sc = SignatureFactory.getInstance().getSignatureCreator(); sc.addTransformAlgorithm("DummyTransform"); ... sc.createSignature(...);
Constructor Summary | |
protected |
Transform(java.lang.String algorithm)
Constructor for the Transform object. |
Method Summary | |
static void |
addTransform(java.lang.String algorithm,
Transform transform)
Registers new transform. |
static Transform |
getInstance(java.lang.String algorithm)
Gets transform instance specified by the algorithm. |
static java.lang.String[] |
getTransforms()
Returns names of the registered transform. |
java.lang.String |
toCanonicalXMLString(java.lang.String signaturePrefix)
Return the canonical XML representation of transform. |
abstract ReferencedData |
transform(ReferencedData input)
Executes transformation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected Transform(java.lang.String algorithm)
algorithm
- the transform algorithmMethod Detail |
public static Transform getInstance(java.lang.String algorithm) throws SignatureException
algorithm
- transform algorithm
SignatureException
- thrown when error occurs.public abstract ReferencedData transform(ReferencedData input) throws SignatureException
input
- an input data source
SignatureException
- thrown when error occurspublic java.lang.String toCanonicalXMLString(java.lang.String signaturePrefix) throws SignatureException
<Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"> </Transform>
signaturePrefix
- prefix of the being created signature
SignatureException
- thrown when error occurs.public static void addTransform(java.lang.String algorithm, Transform transform)
algorithm
- the algorithm to be added.transform
- the Transform object associated with algorithm to be
added.public static java.lang.String[] getTransforms()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |