|
XML Security, 1.6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.xml.crypto.dsig.dom.AlgorithmFactory
public class AlgorithmFactory
Field Summary | |
---|---|
protected java.lang.String |
certProvider
|
protected java.security.Provider |
digestProvider
|
(package private) static boolean |
ENABLE_CACHE
|
protected java.lang.String |
keyProvider
|
protected java.security.Provider |
macProvider
|
protected java.security.Provider |
signatureProvider
|
protected java.util.Set |
supportedDataEncryptions
|
protected java.util.Set<java.lang.String> |
supportedDigests
|
protected java.util.Set |
supportedKeyEncryptions
|
protected java.util.Set |
supportedSignatures
|
Constructor Summary | |
---|---|
protected |
AlgorithmFactory()
|
Method Summary | |
---|---|
boolean |
checkPGPKeyId(byte[] keyId)
|
boolean |
checkPGPKeyPacket(byte[] keyPacket)
|
boolean |
checkURI(java.lang.String uri)
Called by URIReferenceImpl() |
static boolean |
checkURI(java.lang.String uri,
boolean verbose)
|
java.security.spec.AlgorithmParameterSpec |
convertParameter(java.lang.String uri,
java.util.Map properties)
Convert algorithm parameters from properties form to AlgorithmParameterSpec form. |
java.security.cert.Certificate |
generateCertificate(java.io.InputStream is)
|
java.security.cert.CRL |
generateCRL(java.io.InputStream is)
|
java.security.PublicKey |
generatePublic(java.security.spec.KeySpec spec)
|
java.util.Set |
getDataEncryptionAlgorithms()
Return a set of the supported data encryption algorithms by a factory implementation. |
java.util.Set |
getDigestAlgorithms()
Return a set of the supported digest algorithms by a factory implementation. |
javax.xml.parsers.DocumentBuilder |
getDocumentBuilder()
|
EncryptionEngine |
getEncryptionEngine(java.lang.String uri)
Return an instance of EncryptionEngine implementation which handles
the algorithm specified by uri. |
static AlgorithmFactory |
getInstance()
|
java.util.Set |
getKeyEncryptionAlgorithms()
Return a set of the supported key encryption algorithms by a factory implementation. |
KeyGenerationEngine |
getKeyGenerationEngine(java.lang.String uri,
java.lang.String type)
Return an instance of KeyGenerationEngine implementation which handles
the algorithm specified by uri. |
java.security.MessageDigest |
getMessageDigest(java.lang.String uri,
java.security.spec.AlgorithmParameterSpec spec)
Return an instance of MessageDigest implementation which handles
the algorithm specified by uri. |
java.util.Set |
getSignatureAlgorithms()
Return a set of the supported signature algorithms by a factory implementation. |
SignatureEngine |
getSignatureEngine(java.lang.String alg)
Return an instance of SignatureEngine implementation which handles
the algorithm specified by uri. |
void |
marshalParameter(java.lang.String uri,
java.security.spec.AlgorithmParameterSpec spec,
org.w3c.dom.Element el)
Marshal the specified spec under the el element. |
(package private) void |
marshalParameter(java.lang.String uri,
java.security.spec.AlgorithmParameterSpec spec,
org.w3c.dom.Element el,
Marshalling m)
|
org.w3c.dom.Document |
parse(java.io.InputStream stream)
|
org.w3c.dom.Document |
parse(java.lang.String uri)
|
void |
releaseDocumentBuilder(javax.xml.parsers.DocumentBuilder builder)
|
boolean |
releaseEncryptionEngine(EncryptionEngine eng)
This method is called when XML-Signature/XML-Encryption processors finish to use the specified engine instance. |
boolean |
releaseKeyGenerationEngine(KeyGenerationEngine eng)
This method is called when XML-Signature/XML-Encryption processors finish to use the specified engine instance. |
boolean |
releaseMessageDigest(java.lang.String alg,
java.security.MessageDigest d)
This method is called when XML-Signature/XML-Encryption processors finish to use the specified engine instance. |
boolean |
releaseSignatureEngine(SignatureEngine eng)
This method is called when XML-Signature/XML-Encryption processors finish to use the specified engine instance. |
java.security.spec.AlgorithmParameterSpec |
unmarshalParameter(java.lang.String uri,
org.w3c.dom.Element el)
Generate AlgorithmParameterSpec for uri from specified DOM element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final boolean ENABLE_CACHE
protected java.security.Provider digestProvider
protected java.security.Provider signatureProvider
protected java.security.Provider macProvider
protected java.lang.String certProvider
protected java.lang.String keyProvider
protected java.util.Set supportedSignatures
protected java.util.Set<java.lang.String> supportedDigests
protected java.util.Set supportedDataEncryptions
protected java.util.Set supportedKeyEncryptions
Constructor Detail |
---|
protected AlgorithmFactory()
Method Detail |
---|
public static AlgorithmFactory getInstance()
public java.util.Set getDigestAlgorithms()
EngineFactory
getDigestAlgorithms
in interface EngineFactory
String
s representing the supported
digest algorithms.
If there is no algorithms to be supported, return null.public java.security.MessageDigest getMessageDigest(java.lang.String uri, java.security.spec.AlgorithmParameterSpec spec) throws java.security.NoSuchAlgorithmException, java.security.InvalidAlgorithmParameterException
EngineFactory
MessageDigest
implementation which handles
the algorithm specified by uri. A factory implementation
may return a cached MessageDigest
instance.
getMessageDigest
in interface EngineFactory
uri
- Algorithm identifierspec
- An isntance of algorithm-specific sub-class of
AlgorithmParameterSpec
. It may be null
.
MessageDigest
interface.
It supports the algorithm specified by uri
java.security.NoSuchAlgorithmException
- This factory implementation does not support the specified URI.
java.security.InvalidAlgorithmParameterException
- Invalid AlgorithmParameterSpec
is specified.public boolean releaseMessageDigest(java.lang.String alg, java.security.MessageDigest d)
EngineFactory
releaseMessageDigest
in interface EngineFactory
alg
- Algorithm identifier
EngineFactory
.public java.util.Set getSignatureAlgorithms()
EngineFactory
getSignatureAlgorithms
in interface EngineFactory
String
s representing the supported
signature algorithms.
If there is no algorithms to be supported, return null.public SignatureEngine getSignatureEngine(java.lang.String alg) throws java.security.NoSuchAlgorithmException
EngineFactory
SignatureEngine
implementation which handles
the algorithm specified by uri. A factory implementation
may return a cached SignatureEngine instance, and MUST call
SignatureEngine.setParameter()
.
- Specified by:
getSignatureEngine
in interface EngineFactory
- Parameters:
alg
- Algorithm identifier
- Returns:
- An instance of implementation class of
SignatureEngine
interface.
It supports the algorithm specified by uri
- Throws:
java.security.NoSuchAlgorithmException
- This factory implementation does not support the specified URI.
public boolean releaseSignatureEngine(SignatureEngine eng)
EngineFactory
releaseSignatureEngine
in interface EngineFactory
eng
- An instance which is not used anymore.
EngineFactory
.public java.util.Set getDataEncryptionAlgorithms()
EngineFactory
getDataEncryptionAlgorithms
in interface EngineFactory
String
s representing the supported
data encryption algorithms.
If there is no algorithms to be supported, return null.public EncryptionEngine getEncryptionEngine(java.lang.String uri) throws java.security.NoSuchAlgorithmException
EngineFactory
EncryptionEngine
implementation which handles
the algorithm specified by uri. A factory implementation
may return a cached EncryptionEngine
instance.
getEncryptionEngine
in interface EngineFactory
uri
- Algorithm identifier
EncryptionEngine
interface.
It supports the algorithm specified by uri
java.security.NoSuchAlgorithmException
- This factory implementation does not support the specified URI.public boolean releaseEncryptionEngine(EncryptionEngine eng)
EngineFactory
releaseEncryptionEngine
in interface EngineFactory
eng
- An instance which is not used anymore.
EngineFactory
.public java.util.Set getKeyEncryptionAlgorithms()
EngineFactory
getKeyEncryptionAlgorithms
in interface EngineFactory
String
s representing the supported
key encryption algorithms.
If there is no algorithms to be supported, return null.public KeyGenerationEngine getKeyGenerationEngine(java.lang.String uri, java.lang.String type) throws java.security.NoSuchAlgorithmException
EngineFactory
KeyGenerationEngine
implementation which handles
the algorithm specified by uri. A factory implementation
may return a cached KeyGenerationEngine
instance.
getKeyGenerationEngine
in interface EngineFactory
uri
- Algorithm identifiertype
- Type identifier specified as enc:EncryptedKey/@Type.
This may be null
.
KeyGenerationEngine
interface.
It supports the algorithm specified by uri
java.security.NoSuchAlgorithmException
- This factory implementation does not support the specified URI.public boolean releaseKeyGenerationEngine(KeyGenerationEngine eng)
EngineFactory
releaseKeyGenerationEngine
in interface EngineFactory
eng
- An instance which is not used anymore.
EngineFactory
.public java.security.spec.AlgorithmParameterSpec unmarshalParameter(java.lang.String uri, org.w3c.dom.Element el) throws java.security.NoSuchAlgorithmException, java.security.InvalidAlgorithmParameterException
EngineFactory
unmarshalParameter
in interface EngineFactory
uri
- Algorithm identifierel
- An element representing <ds:SingatureMethod>,
<ds:DigestMethod>,
or <enc:EncryptionMethod>.
java.security.NoSuchAlgorithmException
- This factory implementation does not support the specified URI.
java.security.InvalidAlgorithmParameterException
- Parameters in el is invalid.public java.security.spec.AlgorithmParameterSpec convertParameter(java.lang.String uri, java.util.Map properties) throws java.security.NoSuchAlgorithmException, java.security.InvalidAlgorithmParameterException
EngineFactory
AlgorithmParameterSpec
form.
convertParameter
in interface EngineFactory
uri
- Algorithm identifierproperties
- String => String map specified in a configuration.
It may be null
.
AlgorithmParameterSpec
.
It may be null
.
java.security.NoSuchAlgorithmException
- This factory implementation does not support the specified URI.
java.security.InvalidAlgorithmParameterException
- Invalid AlgorithmParameterSpec
is specified.public void marshalParameter(java.lang.String uri, java.security.spec.AlgorithmParameterSpec spec, org.w3c.dom.Element el) throws java.security.NoSuchAlgorithmException, java.security.InvalidAlgorithmParameterException
EngineFactory
marshalParameter
in interface EngineFactory
uri
- Algorithm identifierspec
- Algorithm parameter to be marshalled. It may be null
.el
- An element representing <ds:SingatureMethod>,
<ds:DigestMethod>,
or <enc:EncryptionMethod>.
java.security.NoSuchAlgorithmException
- This factory implementation does not support the specified URI.
java.security.InvalidAlgorithmParameterException
- Invalid AlgorithmParameterSpec
is specified.void marshalParameter(java.lang.String uri, java.security.spec.AlgorithmParameterSpec spec, org.w3c.dom.Element el, Marshalling m) throws java.security.NoSuchAlgorithmException, java.security.InvalidAlgorithmParameterException
c
- may be null
java.security.NoSuchAlgorithmException
java.security.InvalidAlgorithmParameterException
public java.security.PublicKey generatePublic(java.security.spec.KeySpec spec) throws java.security.NoSuchAlgorithmException, java.security.spec.InvalidKeySpecException, java.security.NoSuchProviderException
java.security.NoSuchAlgorithmException
java.security.spec.InvalidKeySpecException
java.security.NoSuchProviderException
public java.security.cert.Certificate generateCertificate(java.io.InputStream is) throws java.security.cert.CertificateException, java.security.NoSuchProviderException
java.security.cert.CertificateException
java.security.NoSuchProviderException
public java.security.cert.CRL generateCRL(java.io.InputStream is) throws java.security.cert.CertificateException, java.security.NoSuchProviderException, java.security.cert.CRLException
java.security.cert.CertificateException
java.security.NoSuchProviderException
java.security.cert.CRLException
public javax.xml.parsers.DocumentBuilder getDocumentBuilder() throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationException
public void releaseDocumentBuilder(javax.xml.parsers.DocumentBuilder builder)
public org.w3c.dom.Document parse(java.lang.String uri) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
public org.w3c.dom.Document parse(java.io.InputStream stream) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
public boolean checkURI(java.lang.String uri)
public static boolean checkURI(java.lang.String uri, boolean verbose)
public boolean checkPGPKeyId(byte[] keyId)
public boolean checkPGPKeyPacket(byte[] keyPacket) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
|
XML Security, 1.6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |