|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensaml.xml.util.XmlTool
public final class XmlTool
| Field Summary | |
|---|---|
static int |
RC_INIT
Return code indicating an initialization error, 1 . |
static int |
RC_INVALID_CRED
Return code indicating an error reading the credentials, 6 . |
static int |
RC_INVALID_XML
Return code indicating input XML was not valid, 4 . |
static int |
RC_INVALID_XS
Return code indicating indicating an error validating the XML, 5 . |
static int |
RC_IO
Return code indicating an error reading files, 2 . |
static int |
RC_MALFORMED_XML
Return code indicating the input XML was not well formed, 3 . |
static int |
RC_OK
Return code indicating command completed successfully, 0 . |
static int |
RC_SIG
Return code indicating indicating that signing or signature verification failed, 7 . |
static int |
RC_UNKNOWN
Return code indicating an unknown error occurred, -1 . |
| Constructor Summary | |
|---|---|
XmlTool()
|
|
| Method Summary | |
|---|---|
protected static void |
addSignatureELement(XmlToolCommandLineArguments cli,
Element root,
Element signature)
Adds the signature element at the appropriate place in the document. |
protected static org.opensaml.xml.security.x509.BasicX509Credential |
getCredential(XmlToolCommandLineArguments cli)
Gets the credentials used for signing and signature verification. |
protected static Collection<X509CRL> |
getCRLs(XmlToolCommandLineArguments cli)
Gets the CRLs referenced on the command line, if any. |
protected static DocumentBuilder |
getParser(XmlToolCommandLineArguments cli)
Constructs a DOM parser used to parse the input XML. |
protected static Element |
getSignatureElement(Document xmlDoc)
Gets the signature element from the document. |
protected static String |
getSignatureReferenceUri(XmlToolCommandLineArguments cli,
Element rootElement)
Gets the reference of the URI to use for the signature. |
protected static InputStream |
getXmlInputStreamFromFile(XmlToolCommandLineArguments cli)
Creates an input stream that reads the input XML from a file. |
protected static InputStream |
getXmlInputStreamFromUrl(XmlToolCommandLineArguments cli)
Creates an input stream that reads the input XML from an HTTP URL. |
protected static void |
initLogging(XmlToolCommandLineArguments cli)
Initialize the logging subsystem. |
static void |
main(String[] args)
|
protected static Document |
parseXML(XmlToolCommandLineArguments cli)
Parses the input XML from its source and converts it to a DOM document. |
protected static void |
populateKeyInfo(Document doc,
org.apache.xml.security.keys.KeyInfo keyInfo,
org.opensaml.xml.security.x509.BasicX509Credential credential)
Populates an XML signature's KeyInfo with X.509 credential information. |
protected static void |
schemaValidate(XmlToolCommandLineArguments cli,
Document xml)
Validates the SAML document against the SAML 1.1 and 2.0 schema. |
protected static void |
sign(XmlToolCommandLineArguments cli,
Document xml)
Signs and outputs the signed SAML document. |
protected static void |
verifySignature(XmlToolCommandLineArguments cli,
Document xmlDocument)
Verifies that the signature on a document is valid. |
protected static void |
writeDocument(XmlToolCommandLineArguments cli,
Node xml)
Writes a DOM element to the output file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int RC_OK
public static final int RC_INIT
public static final int RC_IO
public static final int RC_MALFORMED_XML
public static final int RC_INVALID_XML
public static final int RC_INVALID_XS
public static final int RC_INVALID_CRED
public static final int RC_SIG
public static final int RC_UNKNOWN
| Constructor Detail |
|---|
public XmlTool()
| Method Detail |
|---|
public static void main(String[] args)
args - protected static Document parseXML(XmlToolCommandLineArguments cli)
cli - command line arguments
protected static InputStream getXmlInputStreamFromFile(XmlToolCommandLineArguments cli)
cli - command line arguments
protected static InputStream getXmlInputStreamFromUrl(XmlToolCommandLineArguments cli)
cli - command line arguments
protected static DocumentBuilder getParser(XmlToolCommandLineArguments cli)
cli - command line arguments
protected static void schemaValidate(XmlToolCommandLineArguments cli,
Document xml)
cli - command line argumentsxml - document to validate
protected static void sign(XmlToolCommandLineArguments cli,
Document xml)
cli - command line argumentsxml - document to be signed
protected static void populateKeyInfo(Document doc,
org.apache.xml.security.keys.KeyInfo keyInfo,
org.opensaml.xml.security.x509.BasicX509Credential credential)
doc - XML document in which the elements will be rootedkeyInfo - the KeyInfo to be populatedcredential - the credential
protected static String getSignatureReferenceUri(XmlToolCommandLineArguments cli,
Element rootElement)
cli - command line argumentsrootElement - document root element
protected static void addSignatureELement(XmlToolCommandLineArguments cli,
Element root,
Element signature)
cli - command line argumentroot - element to which the signature will be added as a childsignature - signature to be added to the document's root element
protected static void verifySignature(XmlToolCommandLineArguments cli,
Document xmlDocument)
cli - command line argumentxmlDocument - document whose signature will be validatedprotected static Element getSignatureElement(Document xmlDoc)
xmlDoc - document from which to pull the signature
protected static org.opensaml.xml.security.x509.BasicX509Credential getCredential(XmlToolCommandLineArguments cli)
cli - command line arguments
protected static Collection<X509CRL> getCRLs(XmlToolCommandLineArguments cli)
cli - command line arguments
protected static void writeDocument(XmlToolCommandLineArguments cli,
Node xml)
cli - command line argumentsxml - the XML element to outputprotected static void initLogging(XmlToolCommandLineArguments cli)
cli - command line arguments
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||