|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opensaml.xml.security.SecurityHelper
public final class SecurityHelper
Helper methods for security-related requirements.
Method Summary | |
---|---|
static java.security.Key |
extractDecryptionKey(Credential credential)
Extract the decryption key from the credential. |
static java.security.Key |
extractEncryptionKey(Credential credential)
Extract the encryption key from the credential. |
static java.security.Key |
extractSigningKey(Credential credential)
Extract the signing key from the credential. |
static java.security.Key |
extractVerificationKey(Credential credential)
Extract the verification key from the credential. |
static javax.crypto.SecretKey |
generateSymmetricKey(java.lang.String algoURI)
Generates a random Java JCE symmetric Key object from the specified XML Encryption algorithm URI. |
static CredentialCriteriaSet |
getCredentialCriteria(java.util.Set<Criteria> generalCriteria)
Get the CredentialCriteria from the general more general criteria set and return as a type-specific set. |
static java.lang.String |
getKeyAlgorithmFromURI(java.lang.String algorithmURI)
Get the Java security JCA/JCE key algorithm specifier associated with an algorithm URI. |
static java.lang.Integer |
getKeyLength(java.security.Key key)
Get the key length in bits of the specified key. |
static java.lang.Integer |
getKeyLengthFromURI(java.lang.String algorithmURI)
Get the length of the key indicated by the algorithm URI, if applicable and available. |
static PKIXCriteriaSet |
getPKIXCriteria(java.util.Set<Criteria> generalCriteria)
Get the PKIXCriteria from the general more general criteria set and return as a type-specific set. |
static BasicCredential |
getSimpleCredential(java.security.PublicKey publicKey,
java.security.PrivateKey privateKey)
Get a simple, minimal credential containing a public key, and optionally a private key. |
static BasicCredential |
getSimpleCredential(javax.crypto.SecretKey secretKey)
Get a simple, minimal credential containing a secret (symmetric) key. |
static boolean |
isHMAC(java.lang.String signatureAlgorithm)
Check whether the signature method algorithm URI indicates HMAC. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean isHMAC(java.lang.String signatureAlgorithm)
signatureAlgorithm
- the signature method algorithm URI
public static java.lang.String getKeyAlgorithmFromURI(java.lang.String algorithmURI)
algorithmURI
- the algorithm URI to evaluate
public static java.lang.Integer getKeyLengthFromURI(java.lang.String algorithmURI)
algorithmURI
- the algorithm URI to evaluate
public static javax.crypto.SecretKey generateSymmetricKey(java.lang.String algoURI) throws java.security.NoSuchAlgorithmException, java.security.KeyException
algoURI
- The XML Encryption algorithm URI
java.security.NoSuchAlgorithmException
- thrown if the specified algorithm is invalid
java.security.KeyException
- thrown if the length of the key to generate could not be determinedpublic static java.security.Key extractEncryptionKey(Credential credential)
credential
- the credential containing the encryption key
public static java.security.Key extractDecryptionKey(Credential credential)
credential
- the credential containing the decryption key
public static java.security.Key extractSigningKey(Credential credential)
credential
- the credential containing the signing key
public static java.security.Key extractVerificationKey(Credential credential)
credential
- the credential containing the verification key
public static java.lang.Integer getKeyLength(java.security.Key key)
key
- the key to evaluate
public static BasicCredential getSimpleCredential(javax.crypto.SecretKey secretKey)
secretKey
- the symmetric key to wrap
public static BasicCredential getSimpleCredential(java.security.PublicKey publicKey, java.security.PrivateKey privateKey)
publicKey
- the public key to wrapprivateKey
- the private key to wrap, which may be null
public static CredentialCriteriaSet getCredentialCriteria(java.util.Set<Criteria> generalCriteria)
generalCriteria
- set of criteria
public static PKIXCriteriaSet getPKIXCriteria(java.util.Set<Criteria> generalCriteria)
generalCriteria
- set of criteria
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |