Class SignedInfo
java.lang.Object
org.kopi.ebics.xml.DefaultEbicsRootElement
org.kopi.ebics.xml.SignedInfo
- All Implemented Interfaces:
Serializable, EbicsElement, EbicsRootElement
A representation of the SignedInfo element
performing signature for signed ebics requests
- Author:
- hachani
- See Also:
-
Field Summary
Fields inherited from class DefaultEbicsRootElement
document, session -
Constructor Summary
ConstructorsConstructorDescriptionSignedInfo(EbicsUser user, byte[] digest) Constructs a newSignedInfoelement -
Method Summary
Modifier and TypeMethodDescriptionvoidbuild()Builds theEbicsElementXML fragmentbyte[]Returns the digest value.getName()Returns the name of thisEbicsElementReturns the signed info element as anXmlObjectbyte[]sign(byte[] toSign) Canonizes and signs a given input with the authentication private key. of the EBICS user.byte[]Converts theEbicsElementto a byte arrayMethods inherited from class DefaultEbicsRootElement
addNamespaceDecl, generateName, generateName, insertSchemaLocation, prettyPrint, print, save, setSaveSuggestedPrefixes, toPrettyString, toString, validate
-
Constructor Details
-
SignedInfo
Constructs a newSignedInfoelement- Parameters:
digest- the digest value
-
-
Method Details
-
build
Description copied from interface:EbicsElementBuilds theEbicsElementXML fragment- Throws:
EbicsException
-
getDigest
public byte[] getDigest()Returns the digest value.- Returns:
- the digest value.
-
getSignatureType
Returns the signed info element as anXmlObject- Returns:
- he signed info element
-
sign
Canonizes and signs a given input with the authentication private key. of the EBICS user.The given input to be signed is first Canonized using the http://www.w3.org/TR/2001/REC-xml-c14n-20010315 algorithm.
The element to be canonized is only the SignedInfo element that should be contained in the request to be signed. Otherwise, a
TransformationExceptionis thrown.The namespace of the SignedInfo element should be named ds as specified in the EBICS specification for common namespaces nomination.
The signature is ensured using the user X002 private key. This step is done in
authenticate.- Parameters:
toSign- the input to sign- Returns:
- the signed input
- Throws:
EbicsException- signature fails.
-
toByteArray
public byte[] toByteArray()Description copied from interface:EbicsRootElementConverts theEbicsElementto a byte array- Specified by:
toByteArrayin interfaceEbicsRootElement- Overrides:
toByteArrayin classDefaultEbicsRootElement- Returns:
- the equivalent byte array of this
EbicsElement
-
getName
Description copied from interface:EbicsElementReturns the name of thisEbicsElement- Returns:
- the name of the element
-