org.neuclear.xml.xmlsec
Class SignedInfo

java.lang.Object
  extended by org.neuclear.xml.AbstractElementProxy
      extended by org.neuclear.xml.xmlsec.AbstractXMLSigElement
          extended by org.neuclear.xml.xmlsec.SignedInfo
All Implemented Interfaces:
ElementProxy

public final class SignedInfo
extends AbstractXMLSigElement


Field Summary
static java.lang.String DSIG_ALG_DSA
           
static java.lang.String DSIG_ALG_RSA
           
static java.lang.String JCE_ALG_DSA
           
static java.lang.String JCE_ALG_RSA
           
static int SIG_ALG_DSA
           
static int SIG_ALG_RSA
           
 
Constructor Summary
SignedInfo(org.dom4j.Element elem)
           
SignedInfo(org.dom4j.Element root, int sigalg, boolean enveloped)
           
SignedInfo(int sigalg, int refcount)
           
SignedInfo(Reference[] references, int sigalg)
           
 
Method Summary
 void addEnvelopingReference(org.dom4j.Element elem)
           
 void addExternalReference(java.lang.String url)
           
 byte[] canonicalize()
          Canonicalizes object's XML Representation
(package private)  Canonicalizer getCanonicalizer()
           
 Reference getPrimaryReference()
          Returns the first Reference
 org.dom4j.Element getPrimaryReferenceElement()
          Returns the Element of the first Reference
 java.util.List getReferences()
          Method getSigningKey This returns the signing PublicKey if it exists or null if it doesnt.
(package private)  java.security.Signature getSignatureAlgorithm()
           
 java.lang.String getTagName()
           
 void setEnvelopedReference(org.dom4j.Element elem)
           
 byte[] sign(org.neuclear.commons.crypto.signers.BrowsableSigner signer, KeyInfo.CreateKeyInfoCallBack cb)
           
 byte[] sign(java.security.PrivateKey key)
          Signs the SignedInfo and returns the signature
 byte[] sign(java.lang.String name, org.neuclear.commons.crypto.signers.Signer signer)
           
 boolean verify(java.security.PublicKey pub, byte[] sig)
           
 
Methods inherited from class org.neuclear.xml.AbstractElementProxy
addElement, addElement, addElement, addElement, addElement, addLineBreak, asXML, createAttribute, createQName, getElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIG_ALG_RSA

public static final int SIG_ALG_RSA
See Also:
Constant Field Values

SIG_ALG_DSA

public static final int SIG_ALG_DSA
See Also:
Constant Field Values

DSIG_ALG_RSA

public static final java.lang.String DSIG_ALG_RSA
See Also:
Constant Field Values

DSIG_ALG_DSA

public static final java.lang.String DSIG_ALG_DSA
See Also:
Constant Field Values

JCE_ALG_RSA

public static final java.lang.String JCE_ALG_RSA
See Also:
Constant Field Values

JCE_ALG_DSA

public static final java.lang.String JCE_ALG_DSA
See Also:
Constant Field Values
Constructor Detail

SignedInfo

public SignedInfo(Reference[] references,
                  int sigalg)
           throws XMLSecurityException
Throws:
XMLSecurityException

SignedInfo

public SignedInfo(int sigalg,
                  int refcount)
           throws XMLSecurityException
Throws:
XMLSecurityException

SignedInfo

public SignedInfo(org.dom4j.Element root,
                  int sigalg,
                  boolean enveloped)
           throws XMLSecurityException
Throws:
XMLSecurityException

SignedInfo

public SignedInfo(org.dom4j.Element elem)
           throws XMLSecurityException,
                  InvalidSignatureException
Throws:
XMLSecurityException
InvalidSignatureException
Method Detail

setEnvelopedReference

public void setEnvelopedReference(org.dom4j.Element elem)
                           throws XMLSecurityException
Parameters:
elem -
Throws:
XMLSecurityException

addEnvelopingReference

public void addEnvelopingReference(org.dom4j.Element elem)
                            throws XMLSecurityException
Throws:
XMLSecurityException

addExternalReference

public void addExternalReference(java.lang.String url)
                          throws XMLSecurityException
Throws:
XMLSecurityException

getReferences

public final java.util.List getReferences()
Method getSigningKey This returns the signing PublicKey if it exists or null if it doesnt.

Returns:

getPrimaryReferenceElement

public final org.dom4j.Element getPrimaryReferenceElement()
Returns the Element of the first Reference

Returns:

getPrimaryReference

public final Reference getPrimaryReference()
Returns the first Reference

Returns:

getCanonicalizer

final Canonicalizer getCanonicalizer()

getSignatureAlgorithm

final java.security.Signature getSignatureAlgorithm()
                                             throws XMLSecurityException
Throws:
XMLSecurityException

canonicalize

public final byte[] canonicalize()
                          throws XMLSecurityException
Description copied from interface: ElementProxy
Canonicalizes object's XML Representation

Specified by:
canonicalize in interface ElementProxy
Overrides:
canonicalize in class AbstractElementProxy
Returns:
byte array containing the Canonicalized Object
Throws:
XMLSecurityException

sign

public final byte[] sign(java.security.PrivateKey key)
                  throws XMLSecurityException
Signs the SignedInfo and returns the signature

Parameters:
key -
Returns:
Throws:
XMLSecurityException

sign

public final byte[] sign(java.lang.String name,
                         org.neuclear.commons.crypto.signers.Signer signer)
                  throws XMLSecurityException,
                         org.neuclear.commons.crypto.signers.NonExistingSignerException,
                         org.neuclear.commons.crypto.passphraseagents.UserCancellationException
Throws:
XMLSecurityException
org.neuclear.commons.crypto.signers.NonExistingSignerException
org.neuclear.commons.crypto.passphraseagents.UserCancellationException

sign

public final byte[] sign(org.neuclear.commons.crypto.signers.BrowsableSigner signer,
                         KeyInfo.CreateKeyInfoCallBack cb)
                  throws XMLSecurityException,
                         org.neuclear.commons.crypto.passphraseagents.UserCancellationException
Throws:
XMLSecurityException
org.neuclear.commons.crypto.passphraseagents.UserCancellationException

verify

public final boolean verify(java.security.PublicKey pub,
                            byte[] sig)
                     throws XMLSecurityException
Throws:
XMLSecurityException

getTagName

public final java.lang.String getTagName()


Copyright © 2002-2004 Antilles Software Ventures SA. All Rights Reserved.