|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SecurityEnvironment
The SecurityEnvironment interface links the XWS-Security runtime with the environment/container in which it is running. The SecurityEnvironment interface is invoked by the XWS-Security runtime to perform tasks such as retrieving keys, validating tokens etc.
When using the XWS-Security configuration files with <xwss:JAXRPCSecurity> as the root element, a default implementation of this interface wraps the supplied CallbackHandler. The default implemenation of this interface bundled with XWS-Security invokes the CallbackHandler to implement the methods of this interface.
This interface facilitates usage of XWS-Security in environments which do not necessarily have a natural mapping to the XWS-Security defined callbacks.
There is generally a single SecurityEnvironment instance per-application, which is initialized at application startup.
Note: This interface is evolving and is subject to change in a later release
Method Summary | |
---|---|
boolean |
authenticateUser(java.util.Map context,
java.lang.String username,
java.lang.String password)
Authenticate the user against a list of known username-password pairs. |
boolean |
authenticateUser(java.util.Map context,
java.lang.String username,
java.lang.String passwordDigest,
java.lang.String nonce,
java.lang.String created)
Authenticate the user given the password digest. |
javax.security.auth.callback.CallbackHandler |
getCallbackHandler()
|
java.security.cert.X509Certificate |
getCertificate(java.util.Map context,
java.math.BigInteger serialNumber,
java.lang.String issuerName)
|
java.security.cert.X509Certificate |
getCertificate(java.util.Map context,
byte[] keyIdentifier)
|
java.security.cert.X509Certificate |
getCertificate(java.util.Map context,
java.security.PublicKey publicKey,
boolean forSign)
|
java.security.cert.X509Certificate |
getCertificate(java.util.Map context,
java.lang.String alias,
boolean forSigning)
|
java.security.cert.X509Certificate |
getDefaultCertificate(java.util.Map context)
Retrieves a reasonable default value for the current user's X509Certificate if one exists. |
java.lang.String |
getPassword(java.util.Map context)
|
java.security.PrivateKey |
getPrivateKey(java.util.Map context,
java.math.BigInteger serialNumber,
java.lang.String issuerName)
|
java.security.PrivateKey |
getPrivateKey(java.util.Map context,
byte[] keyIdentifier)
|
java.security.PrivateKey |
getPrivateKey(java.util.Map context,
java.security.PublicKey publicKey,
boolean forSign)
|
java.security.PrivateKey |
getPrivateKey(java.util.Map context,
java.lang.String alias)
|
java.security.PrivateKey |
getPrivateKey(java.util.Map context,
java.security.cert.X509Certificate cert)
|
java.security.PublicKey |
getPublicKey(java.util.Map context,
java.math.BigInteger serialNumber,
java.lang.String issuerName)
|
java.security.PublicKey |
getPublicKey(java.util.Map context,
byte[] keyIdentifier)
|
javax.crypto.SecretKey |
getSecretKey(java.util.Map context,
java.lang.String alias,
boolean encryptMode)
|
javax.security.auth.Subject |
getSubject()
|
java.lang.String |
getUsername(java.util.Map context)
|
org.w3c.dom.Element |
locateSAMLAssertion(java.util.Map context,
org.w3c.dom.Element binding,
java.lang.String assertionId,
org.w3c.dom.Document ownerDoc)
Locate and return a SAML Assertion, given the Authority binding and assertionId |
AuthenticationTokenPolicy.SAMLAssertionBinding |
populateSAMLPolicy(java.util.Map fpcontext,
AuthenticationTokenPolicy.SAMLAssertionBinding policy,
DynamicApplicationContext context)
Locate and update the Policy argument with the SAML Assertion and/or the AuthorityBinding and Assertion ID information. |
void |
updateOtherPartySubject(javax.security.auth.Subject subject,
Assertion assertion)
Update the public credentials of the subject of the party whose Assertion is given. |
void |
updateOtherPartySubject(javax.security.auth.Subject subject,
java.lang.String username,
java.lang.String password)
Update the public/private credentials of the subject of the party whose username password pair is given. |
void |
updateOtherPartySubject(javax.security.auth.Subject subject,
java.security.cert.X509Certificate cert)
Update the public credentials of the subject of the party whose certificate is given. |
boolean |
validateAndCacheNonce(java.lang.String nonce,
java.lang.String created,
long maxNonceAge)
Validate the given nonce. |
boolean |
validateCertificate(java.security.cert.X509Certificate cert)
Validate an X509Certificate. |
void |
validateCreationTime(java.util.Map context,
java.lang.String creationTime,
long maxClockSkew,
long timestampFreshnessLimit)
Validate the creation time. |
void |
validateSAMLAssertion(java.util.Map context,
org.w3c.dom.Element assertion)
Validate the received SAML Assertion Validations can include validating the Issuer and the Saml User, SAML Version etc. |
void |
validateTimestamp(java.util.Map context,
com.sun.xml.wss.core.Timestamp timestamp,
long maxClockSkew,
long freshnessLimit)
Validate the creation time. |
Method Detail |
---|
java.security.cert.X509Certificate getDefaultCertificate(java.util.Map context) throws XWSSecurityException
context
- a Map of application and integration-layer specific properties
XWSSecurityException
java.security.cert.X509Certificate getCertificate(java.util.Map context, java.lang.String alias, boolean forSigning) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertiesalias
- the alias for identifying the certificateforSigning
- whether this request is for a Sign operation or Encrypt
XWSSecurityException
- if there was an error while trying to locate the Cerificatejavax.crypto.SecretKey getSecretKey(java.util.Map context, java.lang.String alias, boolean encryptMode) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertiesalias
- the alias for identifying the SecretKeyencryptMode
- whether this request is for an Encrypt or Decrypt operation
XWSSecurityException
- if there was an error while trying to locate the SecretKeyjava.security.PrivateKey getPrivateKey(java.util.Map context, java.lang.String alias) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertiesalias
- the alias for identifying the PrivateKey
XWSSecurityException
- if there was an error while trying to locate the PrivateKeyjava.security.PublicKey getPublicKey(java.util.Map context, byte[] keyIdentifier) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertieskeyIdentifier
- an Opaque identifier indicating
the X509 certificate.
XWSSecurityException
- if there was an error while trying to locate the PublicKeyjava.security.cert.X509Certificate getCertificate(java.util.Map context, byte[] keyIdentifier) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertieskeyIdentifier
- an Opaque identifier indicating
the X509 certificate.
XWSSecurityException
- if there was an error while trying to locate the X509Certificatejava.security.PrivateKey getPrivateKey(java.util.Map context, java.security.cert.X509Certificate cert) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertiescert
- the X509Certificate
XWSSecurityException
- if there was an error while trying to locate the PrivateKeyjava.security.PrivateKey getPrivateKey(java.util.Map context, java.math.BigInteger serialNumber, java.lang.String issuerName) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertiesserialNumber
- the serialNumber of the certificateissuerName
- the issuerName of the certificate
XWSSecurityException
- if there was an error while trying to locate the PrivateKeyjava.security.cert.X509Certificate getCertificate(java.util.Map context, java.security.PublicKey publicKey, boolean forSign) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertiespublicKey
- the publicKeyforSign
- set to true if the public key is to be used for SignatureVerification
XWSSecurityException
- if there was an error while trying to locate the PublicKeyjava.security.PrivateKey getPrivateKey(java.util.Map context, byte[] keyIdentifier) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertieskeyIdentifier
- an Opaque identifier indicating
the X509 certificate.
XWSSecurityException
- if there was an error while trying to locate the PrivateKeyjava.security.PrivateKey getPrivateKey(java.util.Map context, java.security.PublicKey publicKey, boolean forSign) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertiespublicKey
- the publicKeyforSign
- set to true if the purpose is Signature
XWSSecurityException
- if there was an error while trying to locate the PrivateKeyjava.security.PublicKey getPublicKey(java.util.Map context, java.math.BigInteger serialNumber, java.lang.String issuerName) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertiesserialNumber
- the serialNumber of the certificateissuerName
- the issuerName of the certificate
XWSSecurityException
- if there was an error while trying to locate the PublicKeyjava.security.cert.X509Certificate getCertificate(java.util.Map context, java.math.BigInteger serialNumber, java.lang.String issuerName) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertiesserialNumber
- the serialNumber of the certificateissuerName
- the issuerName of the certificate
XWSSecurityException
- if there was an error while trying to locate the X509Certificateboolean authenticateUser(java.util.Map context, java.lang.String username, java.lang.String password) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertiesusername
- the usernamepassword
- the password
XWSSecurityException
- if there was an error while trying to authenticate the usernameboolean authenticateUser(java.util.Map context, java.lang.String username, java.lang.String passwordDigest, java.lang.String nonce, java.lang.String created) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertiesusername
- the usernamepasswordDigest
- the digested passwordnonce
- the nonce which was part of the digestcreated
- the creation time which was part of the digest
XWSSecurityException
- if there was an error while trying to authenticate the usernamejavax.security.auth.Subject getSubject()
void validateCreationTime(java.util.Map context, java.lang.String creationTime, long maxClockSkew, long timestampFreshnessLimit) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertiescreationTime
- the creation-time valuemaxClockSkew
- (in milliseconds) the maximum clockskewtimestampFreshnessLimit
- (in milliseconds) the limit for which timestamps
are considered fresh
XWSSecurityException
- if there was an error while trying to validate the creationTimeboolean validateCertificate(java.security.cert.X509Certificate cert) throws XWSSecurityException
cert
- the X509Certificate to be validated
XWSSecurityException
- if there is some problem during validation.void updateOtherPartySubject(javax.security.auth.Subject subject, java.lang.String username, java.lang.String password)
subject
- the Subject of the requesting partyusername
- the username of the requesting partypassword
- the password of the requesting partyvoid updateOtherPartySubject(javax.security.auth.Subject subject, java.security.cert.X509Certificate cert)
subject
- the Subject of the requesting partycert
- the X509Certificate of the requesting partyvoid updateOtherPartySubject(javax.security.auth.Subject subject, Assertion assertion)
subject
- the Subject of the requesting partyassertion
- the SAML Assertion of the requesting partyvoid validateSAMLAssertion(java.util.Map context, org.w3c.dom.Element assertion) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertiesassertion
- the Assertion to be validated
XWSSecurityException
- if there was an error while validating the SAML Assertionorg.w3c.dom.Element locateSAMLAssertion(java.util.Map context, org.w3c.dom.Element binding, java.lang.String assertionId, org.w3c.dom.Document ownerDoc) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertiesbinding
- an org.w3c.dom.Element representing the SAML AuthorityBindingassertionId
- the Assertion ID of the SAML AssertionownerDoc
- the owner document into which the returned SAML Assertion should be imported to
XWSSecurityException
- if there was an error while trying to locate the SAML AssertionAuthenticationTokenPolicy.SAMLAssertionBinding populateSAMLPolicy(java.util.Map fpcontext, AuthenticationTokenPolicy.SAMLAssertionBinding policy, DynamicApplicationContext context) throws XWSSecurityException
fpcontext
- a Map of application and integration-layer specific propertiespolicy
- the SAML Assertion Policy to be populatedcontext
- the DynamicApplicationContext
XWSSecurityException
- if there was an error while trying to populate the SAML Assertion Policyjava.lang.String getUsername(java.util.Map context) throws XWSSecurityException
context
- a Map of application and integration-layer specific properties
XWSSecurityException
- if there was an error while trying obtain the usernamejava.lang.String getPassword(java.util.Map context) throws XWSSecurityException
context
- a Map of application and integration-layer specific properties
XWSSecurityException
- if there was an error while trying obtain the passwordvoid validateTimestamp(java.util.Map context, com.sun.xml.wss.core.Timestamp timestamp, long maxClockSkew, long freshnessLimit) throws XWSSecurityException
context
- a Map of application and integration-layer specific propertiestimestamp
- the Timestamp elementmaxClockSkew
- (in milliseconds) the maximum clockskewfreshnessLimit
- (in milliseconds) the limit for which timestamps
are considered fresh
XWSSecurityException
- if there was an error while trying validate the Timestampjavax.security.auth.callback.CallbackHandler getCallbackHandler() throws XWSSecurityException
XWSSecurityException
- if there was an error while trying retrieve the CallbackHandlerboolean validateAndCacheNonce(java.lang.String nonce, java.lang.String created, long maxNonceAge) throws XWSSecurityException
nonce
- the encoded nonce valuecreated
- the creation time valuemaxNonceAge
- the time in milliseconds for which this nonce
will be stored on the receiver.
XWSSecurityException
- if there was an error while trying to validate the Nonce
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |