public class WssProviderSecurityEnvironment extends Object implements SecurityEnvironment
| Modifier and Type | Field and Description |
|---|---|
protected long |
MAX_CLOCK_SKEW |
protected long |
TIMESTAMP_FRESHNESS_LIMIT |
| Constructor and Description |
|---|
WssProviderSecurityEnvironment(CallbackHandler handler,
Map options) |
| Modifier and Type | Method and Description |
|---|---|
String |
authenticateUser(Map context,
String username)
Authenticate the user given the username and context.
|
boolean |
authenticateUser(Map context,
String username,
String password)
Authenticate the user against a list of known username-password
pairs.
|
boolean |
authenticateUser(Map context,
String username,
String passwordDigest,
String nonce,
String created)
Authenticate the user given the password digest.
|
KerberosContext |
doKerberosLogin()
Perform a Kerberos Login and return a Kerberos Context
KerberosContext stores the secretKey, GSSContext, kerberos BST etc
|
KerberosContext |
doKerberosLogin(byte[] tokenValue)
Perform a Kerberos Login and return a Kerberos Context
KerberosContext stores the secretKey, GSSContext, kerberos BST etc
|
CallbackHandler |
getCallbackHandler() |
X509Certificate |
getCertificate(Map context,
BigInteger serialNumber,
String issuerName) |
X509Certificate |
getCertificate(Map context,
byte[] ski) |
X509Certificate |
getCertificate(Map context,
byte[] identifier,
String valueType) |
X509Certificate |
getCertificate(Map context,
PublicKey publicKey,
boolean forSign) |
X509Certificate |
getCertificate(Map context,
String alias,
boolean forSigning) |
X509Certificate |
getCertificate(String keyIdentifier) |
X509Certificate |
getDefaultCertificate(Map context)
Retrieves a reasonable default value for the current user's
X509Certificate if one exists.
|
X509Certificate |
getMatchingCertificate(Map context,
BigInteger serialNumber,
String issuerName) |
X509Certificate |
getMatchingCertificate(Map context,
byte[] keyIdMatch) |
X509Certificate |
getMatchingCertificate(Map context,
byte[] keyIdMatch,
String valueType) |
String |
getPassword(Map context)
Not implemented: AuthModules use Callbacks internally
|
PrivateKey |
getPrivateKey(Map context,
BigInteger serialNumber,
String issuerName) |
PrivateKey |
getPrivateKey(Map context,
byte[] keyIdentifier) |
PrivateKey |
getPrivateKey(Map context,
byte[] keyIdentifier,
String valueType) |
PrivateKey |
getPrivateKey(Map context,
PublicKey publicKey,
boolean forSign) |
PrivateKey |
getPrivateKey(Map context,
String alias) |
PrivateKey |
getPrivateKey(Map context,
X509Certificate cert) |
PublicKey |
getPublicKey(Map context,
BigInteger serialNumber,
String issuerName) |
PublicKey |
getPublicKey(Map context,
byte[] keyIdentifier) |
PublicKey |
getPublicKey(Map context,
byte[] identifier,
String valueType) |
PublicKey |
getPublicKey(String keyIdentifier) |
Subject |
getRequesterSubject(Map context) |
SecretKey |
getSecretKey(Map context,
String alias,
boolean encryptMode) |
Subject |
getSubject() |
Subject |
getSubject(Map context) |
static byte[] |
getThumbprintIdentifier(X509Certificate cert) |
String |
getUsername(Map context)
Not implemented: AuthModules use Callbacks internally
|
boolean |
isSelfCertificate(X509Certificate cert) |
Element |
locateSAMLAssertion(Map context,
Element binding,
String assertionId,
Document ownerDoc)
Locate and return a SAML Assertion, given the Authority binding and assertionId
|
AuthenticationTokenPolicy.SAMLAssertionBinding |
populateSAMLPolicy(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 |
setRequesterSubject(Subject subject,
Map context) |
void |
setSubject(Subject subject,
Map context) |
void |
updateOtherPartySubject(Subject subject,
Assertion assertion)
Update the public credentials of the subject of the party
whose Assertion is given.
|
void |
updateOtherPartySubject(Subject subject,
GSSName clientCred,
GSSCredential gssCred)
Update the principal/credentials of the requesting party subject
|
void |
updateOtherPartySubject(Subject subject,
Key secretKey) |
void |
updateOtherPartySubject(Subject subj,
String encryptedKey) |
void |
updateOtherPartySubject(Subject subject,
String username,
String password)
Update the public/private credentials of the subject of the party
whose username password pair is given.
|
void |
updateOtherPartySubject(Subject subject,
Subject bootStrapSubject)
Update the principal/credentials of the requesting party subject
|
void |
updateOtherPartySubject(Subject subject,
X509Certificate cert)
Update the public credentials of the subject of the party
whose certificate is given.
|
void |
updateOtherPartySubject(Subject subject,
XMLStreamReader assertion)
Update the public credentials of the subject of the party
whose Assertion is given.
|
boolean |
validateAndCacheNonce(Map context,
String nonce,
String created,
long maxNonceAge)
Validate the given nonce.
|
boolean |
validateCertificate(X509Certificate cert,
Map context)
Validate an X509Certificate.
|
void |
validateCreationTime(Map context,
String creationTime,
long maxClockSkew,
long timestampFreshnessLimit)
Validate the creation time.
|
void |
validateSAMLAssertion(Map context,
Element assertion)
Validate the received SAML Assertion
Validations can include validating the Issuer and the Saml User, SAML Version etc.
|
void |
validateSAMLAssertion(Map context,
XMLStreamReader assertion)
Validate the received SAML Assertion
Validations can include validating the Issuer and the Saml User, SAML Version etc.
|
boolean |
validateSamlIssuer(String issuer) |
boolean |
validateSamlUser(String user,
String domain,
String format) |
void |
validateTimestamp(Map context,
String created,
String expires,
long maxClockSkew,
long freshnessLimit) |
void |
validateTimestamp(Map context,
Timestamp timestamp,
long maxClockSkew,
long freshnessLimit)
Validate the creation time.
|
protected final long MAX_CLOCK_SKEW
protected final long TIMESTAMP_FRESHNESS_LIMIT
public WssProviderSecurityEnvironment(CallbackHandler handler, Map options) throws XWSSecurityException
XWSSecurityExceptionpublic PrivateKey getPrivateKey(Map context, String alias) throws XWSSecurityException
getPrivateKey in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesalias - the alias for identifying the PrivateKeyXWSSecurityException - if there was an error while trying to locate the PrivateKeypublic PrivateKey getPrivateKey(Map context, byte[] keyIdentifier) throws XWSSecurityException
getPrivateKey in interface SecurityEnvironmentcontext - 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 PrivateKeypublic PrivateKey getPrivateKey(Map context, X509Certificate cert) throws XWSSecurityException
getPrivateKey in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiescert - the X509CertificateXWSSecurityException - if there was an error while trying to locate the PrivateKeypublic PrivateKey getPrivateKey(Map context, BigInteger serialNumber, String issuerName) throws XWSSecurityException
getPrivateKey in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesserialNumber - the serialNumber of the certificateissuerName - the issuerName of the certificateXWSSecurityException - if there was an error while trying to locate the PrivateKeypublic X509Certificate getDefaultCertificate(Map context) throws XWSSecurityException
getDefaultCertificate in interface SecurityEnvironmentcontext - XWSSecurityExceptionXWSSecurityExceptionpublic boolean authenticateUser(Map context, String username, String password) throws XWSSecurityException
authenticateUser in interface SecurityEnvironmentusername - password - context - a Map of application and integration-layer specific propertiesXWSSecurityException - if there was an error while trying to authenticate the usernamepublic String authenticateUser(Map context, String username) throws XWSSecurityException
SecurityEnvironmentauthenticateUser in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesusername - the usernameXWSSecurityException - if there was an error while trying to authenticate the usernamepublic boolean authenticateUser(Map context, String username, String passwordDigest, String nonce, String created) throws XWSSecurityException
authenticateUser in interface SecurityEnvironmentusername - passwordDigest - nonce - created - context - a Map of application and integration-layer specific propertiesXWSSecurityException - if there was an error while trying to authenticate the usernamepublic boolean validateCertificate(X509Certificate cert, Map context) throws XWSSecurityException
validateCertificate in interface SecurityEnvironmentcert - the X509Certificate to be validatedcontext - Map of application and integration-layer specific propertiesXWSSecurityException - if there is some problem during validation.public X509Certificate getMatchingCertificate(Map context, byte[] keyIdMatch) throws XWSSecurityException
keyIdMatch - KeyIdentifier to search forXWSSecurityExceptionpublic X509Certificate getMatchingCertificate(Map context, BigInteger serialNumber, String issuerName) throws XWSSecurityException
XWSSecurityExceptionpublic X509Certificate getMatchingCertificate(Map context, byte[] keyIdMatch, String valueType) throws XWSSecurityException
keyIdMatch - KeyIdentifier to search forXWSSecurityExceptionpublic SecretKey getSecretKey(Map context, String alias, boolean encryptMode) throws XWSSecurityException
getSecretKey in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesalias - the alias for identifying the SecretKeyencryptMode - whether this request is for an Encrypt or Decrypt operationXWSSecurityException - if there was an error while trying to locate the SecretKeypublic X509Certificate getCertificate(Map context, String alias, boolean forSigning) throws XWSSecurityException
getCertificate in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesalias - the alias for identifying the certificateforSigning - whether this request is for a Sign operation or EncryptXWSSecurityException - if there was an error while trying to locate the Cerificatepublic static byte[] getThumbprintIdentifier(X509Certificate cert) throws XWSSecurityException
XWSSecurityExceptionpublic void updateOtherPartySubject(Subject subject, String username, String password)
SecurityEnvironmentupdateOtherPartySubject in interface SecurityEnvironmentsubject - the Subject of the requesting partyusername - the username of the requesting partypassword - the password of the requesting partypublic void updateOtherPartySubject(Subject subject, X509Certificate cert)
SecurityEnvironmentupdateOtherPartySubject in interface SecurityEnvironmentsubject - the Subject of the requesting partycert - the X509Certificate of the requesting partypublic void updateOtherPartySubject(Subject subject, Assertion assertion)
SecurityEnvironmentupdateOtherPartySubject in interface SecurityEnvironmentsubject - the Subject of the requesting partyassertion - the SAML Assertion of the requesting partypublic PublicKey getPublicKey(Map context, BigInteger serialNumber, String issuerName) throws XWSSecurityException
getPublicKey in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesserialNumber - the serialNumber of the certificateissuerName - the issuerName of the certificateXWSSecurityException - if there was an error while trying to locate the PublicKeypublic PublicKey getPublicKey(String keyIdentifier) throws XWSSecurityException
XWSSecurityExceptionpublic PublicKey getPublicKey(Map context, byte[] keyIdentifier) throws XWSSecurityException
getPublicKey in interface SecurityEnvironmentcontext - 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 PublicKeypublic PublicKey getPublicKey(Map context, byte[] identifier, String valueType) throws XWSSecurityException
getPublicKey in interface SecurityEnvironmentXWSSecurityExceptionpublic X509Certificate getCertificate(Map context, BigInteger serialNumber, String issuerName) throws XWSSecurityException
getCertificate in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesserialNumber - the serialNumber of the certificateissuerName - the issuerName of the certificateXWSSecurityException - if there was an error while trying to locate the X509Certificatepublic X509Certificate getCertificate(String keyIdentifier) throws XWSSecurityException
XWSSecurityExceptionpublic PrivateKey getPrivateKey(Map context, PublicKey publicKey, boolean forSign)
getPrivateKey in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiespublicKey - the publicKeyforSign - set to true if the purpose is Signaturepublic X509Certificate getCertificate(Map context, byte[] ski)
getCertificate in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesski - an Opaque identifier indicating
the X509 certificate.public X509Certificate getCertificate(Map context, PublicKey publicKey, boolean forSign) throws XWSSecurityException
getCertificate in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiespublicKey - the publicKeyforSign - set to true if the public key is to be used for SignatureVerificationXWSSecurityException - if there was an error while trying to locate the PublicKeypublic X509Certificate getCertificate(Map context, byte[] identifier, String valueType) throws XWSSecurityException
getCertificate in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesidentifier - an Opaque identifier indicating the X509 certificate.XWSSecurityException - if there was an error while trying to locate the X509Certificatepublic boolean validateSamlIssuer(String issuer)
public Subject getSubject()
getSubject in interface SecurityEnvironmentpublic String getUsername(Map context) throws XWSSecurityException
getUsername in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesXWSSecurityException - if there was an error while trying obtain the usernamepublic String getPassword(Map context) throws XWSSecurityException
getPassword in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesXWSSecurityException - if there was an error while trying obtain the passwordpublic boolean validateAndCacheNonce(Map context, String nonce, String created, long maxNonceAge) throws XWSSecurityException
SecurityEnvironmentvalidateAndCacheNonce in interface SecurityEnvironmentcontext - a context containing runtime propertiesnonce - 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 Noncepublic void validateTimestamp(Map context, String created, String expires, long maxClockSkew, long freshnessLimit) throws XWSSecurityException
validateTimestamp in interface SecurityEnvironmentXWSSecurityExceptionpublic void validateTimestamp(Map context, Timestamp timestamp, long maxClockSkew, long freshnessLimit) throws XWSSecurityException
SecurityEnvironmentvalidateTimestamp in interface SecurityEnvironmentcontext - 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 freshXWSSecurityException - if there was an error while trying validate the Timestamppublic void validateCreationTime(Map context, String creationTime, long maxClockSkew, long timestampFreshnessLimit) throws XWSSecurityException
SecurityEnvironmentvalidateCreationTime in interface SecurityEnvironmentcontext - 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 freshXWSSecurityException - if there was an error while trying to validate the creationTimepublic CallbackHandler getCallbackHandler() throws XWSSecurityException
getCallbackHandler in interface SecurityEnvironmentXWSSecurityException - if there was an error while trying retrieve the CallbackHandlerpublic void validateSAMLAssertion(Map context, Element assertion) throws XWSSecurityException
SecurityEnvironmentvalidateSAMLAssertion in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesassertion - the Assertion to be validatedXWSSecurityException - if there was an error while validating the SAML Assertionpublic Element locateSAMLAssertion(Map context, Element binding, String assertionId, Document ownerDoc) throws XWSSecurityException
SecurityEnvironmentlocateSAMLAssertion in interface SecurityEnvironmentcontext - 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 toXWSSecurityException - if there was an error while trying to locate the SAML Assertionpublic AuthenticationTokenPolicy.SAMLAssertionBinding populateSAMLPolicy(Map fpcontext, AuthenticationTokenPolicy.SAMLAssertionBinding policy, DynamicApplicationContext context) throws XWSSecurityException
SecurityEnvironmentpopulateSAMLPolicy in interface SecurityEnvironmentfpcontext - a Map of application and integration-layer specific propertiespolicy - the SAML Assertion Policy to be populatedcontext - the DynamicApplicationContextXWSSecurityException - if there was an error while trying to populate the SAML Assertion Policypublic PrivateKey getPrivateKey(Map context, byte[] keyIdentifier, String valueType) throws XWSSecurityException
getPrivateKey in interface SecurityEnvironmentXWSSecurityExceptionpublic void validateSAMLAssertion(Map context, XMLStreamReader assertion) throws XWSSecurityException
SecurityEnvironmentvalidateSAMLAssertion in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesassertion - the Assertion to be validatedXWSSecurityException - if there was an error while validating the SAML Assertionpublic void updateOtherPartySubject(Subject subject, XMLStreamReader assertion)
SecurityEnvironmentupdateOtherPartySubject in interface SecurityEnvironmentsubject - the Subject of the requesting partyassertion - the SAML Assertion of the requesting partypublic boolean isSelfCertificate(X509Certificate cert)
isSelfCertificate in interface SecurityEnvironmentpublic void updateOtherPartySubject(Subject subject, Subject bootStrapSubject)
SecurityEnvironmentupdateOtherPartySubject in interface SecurityEnvironmentsubject - the Subject of the requesting partybootStrapSubject - the bootstrap Credentials (during a SecureConversation Bootstrap) of the requesting partypublic KerberosContext doKerberosLogin() throws XWSSecurityException
SecurityEnvironmentdoKerberosLogin in interface SecurityEnvironmentXWSSecurityExceptionpublic KerberosContext doKerberosLogin(byte[] tokenValue) throws XWSSecurityException
SecurityEnvironmentdoKerberosLogin in interface SecurityEnvironmentXWSSecurityExceptionpublic void updateOtherPartySubject(Subject subject, GSSName clientCred, GSSCredential gssCred)
SecurityEnvironmentupdateOtherPartySubject in interface SecurityEnvironmentsubject - the Subject of the requesting partyclientCred - the GSSName of the requesting partyCopyright © 2005–2018 Oracle Corporation. All rights reserved.