public class DigSigUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CANONICALIZATIONMETHOD
default is CanonicalizationMethod.EXCLUSIVE
http://www.w3.org/2001/10/xml-exc-c14n#
|
static String |
CHECK_REVOCATION_STATUS_CRL |
static String |
CHECK_REVOCATION_STATUS_OCSP |
static String |
CHECK_TIMESTAMPS
When validating a signature, include this field will validate that
the signature is still valid with regards to timestamps NotBefore and
OnOrAfter
Example
|
static String |
CHECK_TRUST_CHAIN |
static String |
SIGNATURE_KEYSTORE_FILE
This is the location of the keystore
If referencing a Windows certificate store, use WINDOWS-MY as a value
with a null password
|
static String |
SIGNATURE_KEYSTORE_FILE_PASSWORD |
static String |
SIGNATURE_KEYSTORE_FILE_PASSWORD_CIPHER |
static String |
SIGNATURE_KEYSTORE_FILE_PASSWORD_PROVIDER |
static String |
SIGNATURE_KEYSTORE_FILE_PASSWORD_WASENC |
static String |
SIGNATURE_KEYSTORE_FILETYPE
The type of file, such as JKS for most Java applications, or
WINDOWS-MY to use the Windows certificate store of the current user
or KeychainStore for MacOS
|
static String |
SIGNATURE_KEYSTORE_KEY_ALIAS |
static String |
SIGNATURE_KEYSTORE_KEY_PASSWORD |
static String |
SIGNATURE_KEYSTORE_KEY_PASSWORD_CIPHER |
static String |
SIGNATURE_KEYSTORE_KEY_PASSWORD_PROVIDER |
static String |
SIGNATURE_KEYSTORE_KEY_PASSWORD_WAS_ENC |
static String |
SIGNATURE_METHOD
default is http://www.w3.org/2000/09/xmldsig#rsa-sha1
|
static String |
SIGNATURE_OPTION_CERT_INCLUSION_BASE64
Defines whether or not a certificate is included with the
signature
Values - Include whole X509 Public Key in the signature (recommended) (default) * Example |
static String |
SIGNATURE_OPTION_CERT_INCLUSION_SERIAL
Include the signer's serial of the public key and the issuer's
subject name
Clients will not be able to validate the signature unless they have a
copy of the signer's public key in a trust store or the full
certificate is included out of band
Example
|
static String |
SIGNATURE_OPTION_CERT_INCLUSION_SUBJECTDN
Include the signer's Subject DN of the public key.
|
static String |
SIGNATURE_OPTION_DIGEST_METHOD
Default value DigestMethod.SHA1 =
"http://www.w3.org/2000/09/xmldsig#sha1"
|
static String |
TRUSTSTORE_FILE |
static String |
TRUSTSTORE_FILE_PASSWORD |
static String |
TRUSTSTORE_FILE_PASSWORD_CIPHER |
static String |
TRUSTSTORE_FILE_PASSWORD_PROVIDER |
static String |
TRUSTSTORE_FILE_PASSWORD_WASENC |
static String |
TRUSTSTORE_FILETYPE |
static String |
XML_DIGSIG_NS
This is the namespace of the digital signature.
|
Constructor and Description |
---|
DigSigUtil() |
DigSigUtil(Properties config)
Expects a properties object containing the desired configuration
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
clears the configuration for reuse
|
X509Certificate |
getSigningCertificatePublicKey(Object obj)
returns the public key of the signing certificate used for a signed
JAXB object.
|
static void |
JAXB_ToStdOut(Object obj)
Serializes a JAXB object and prints to stdout
|
static String |
JAXB_ToString(Object obj)
Serializes a JAXB object and prints to stdout
|
void |
put(String key,
String value) |
<T> T |
signUddiEntity(T jaxbObj)
Digital signs a UDDI entity, such as a business, service, tmodel or
binding template using the map to provide certificate key stores and
credentials
The UDDI entity MUST support XML Digital Signatures (tModel, Business, Service, Binding Template) |
<T> T |
signUddiEntity(T jaxbObj,
Certificate publicKey,
PrivateKey privateKey)
Digitally signs a UDDI entity, such as a business, service, tmodel or
binding template, provided you've already done the legwork to provide
the signing keys
The UDDI entity MUST support XML Digital Signatures (tModel, Business, Service, Binding Template) |
boolean |
verifySignedUddiEntity(Object obj,
AtomicReference<String> OutErrorMessage)
Verifies the signature on an enveloped digital signature on a UDDI
entity, such as a business, service, tmodel or binding template.
|
public static final String SIGNATURE_KEYSTORE_KEY_PASSWORD_PROVIDER
public static final String SIGNATURE_KEYSTORE_KEY_PASSWORD_WAS_ENC
public static final String SIGNATURE_KEYSTORE_KEY_PASSWORD_CIPHER
public static final String SIGNATURE_KEYSTORE_FILE_PASSWORD_WASENC
public static final String SIGNATURE_KEYSTORE_FILE_PASSWORD_PROVIDER
public static final String TRUSTSTORE_FILE_PASSWORD_WASENC
public static final String TRUSTSTORE_FILE_PASSWORD_PROVIDER
public static final String SIGNATURE_KEYSTORE_FILE_PASSWORD_CIPHER
public static final String TRUSTSTORE_FILE_PASSWORD_CIPHER
public static final String SIGNATURE_KEYSTORE_FILE
public static final String SIGNATURE_KEYSTORE_FILETYPE
public static final String SIGNATURE_KEYSTORE_FILE_PASSWORD
public static final String SIGNATURE_KEYSTORE_KEY_PASSWORD
public static final String SIGNATURE_KEYSTORE_KEY_ALIAS
public static final String TRUSTSTORE_FILE
public static final String TRUSTSTORE_FILETYPE
public static final String TRUSTSTORE_FILE_PASSWORD
public static final String CANONICALIZATIONMETHOD
CanonicalizationMethod
,
Constant Field Valuespublic static final String SIGNATURE_METHOD
SignatureMethod
,
Constant Field Valuespublic static final String SIGNATURE_OPTION_CERT_INCLUSION_BASE64
Map map = new HashMap(); map.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_BASE64, "true");any value can be used.
public static final String SIGNATURE_OPTION_CERT_INCLUSION_SERIAL
Map map = new HashMap(); map.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SERIAL, "true");any value can be used. see
SIGNATURE_OPTION_CERT_INCLUSION_BASE64
public static final String SIGNATURE_OPTION_CERT_INCLUSION_SUBJECTDN
Map map = new HashMap(); map.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SUBJECTDN, "true");any value can be used. see
SIGNATURE_OPTION_CERT_INCLUSION_BASE64
public static final String XML_DIGSIG_NS
public static final String SIGNATURE_OPTION_DIGEST_METHOD
DigestMethod
,
Constant Field Valuespublic static final String CHECK_TIMESTAMPS
Map map = new HashMap(); map.put(DigSigUtil.CHECK_TIMESTAMPS, true);any value can be used.
public static final String CHECK_REVOCATION_STATUS_OCSP
public static final String CHECK_REVOCATION_STATUS_CRL
public static final String CHECK_TRUST_CHAIN
public DigSigUtil(Properties config) throws CertificateException
config
- CertificateException
public DigSigUtil() throws CertificateException
CertificateException
public void clear()
public <T> T signUddiEntity(T jaxbObj)
T
- Any UDDI entity that supports digital signaturesjaxbObj
- public <T> T signUddiEntity(T jaxbObj, Certificate publicKey, PrivateKey privateKey)
T
- jaxbObj
- publicKey
- privateKey
- public static void JAXB_ToStdOut(Object obj)
obj
- public static String JAXB_ToString(Object obj)
obj
- public X509Certificate getSigningCertificatePublicKey(Object obj) throws IllegalArgumentException, CertificateException
obj
- IllegalArgumentException
- for null inputCertificateException
public boolean verifySignedUddiEntity(Object obj, AtomicReference<String> OutErrorMessage) throws IllegalArgumentException
obj
- an enveloped signed JAXB objectOutErrorMessage
- a human readable error message explaining the
reason for failureIllegalArgumentException
- for null inputCopyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.