public class DefaultSamlTransformer extends Object implements SamlTransformer, org.springframework.beans.factory.InitializingBean
Constructor and Description |
---|
DefaultSamlTransformer(SpringSecuritySaml implementation) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
Saml2Object |
fromXml(byte[] xml,
List<SimpleKey> verificationKeys,
List<SimpleKey> localKeys)
Converts an SAML/XML string into a Java object
|
String |
samlDecode(String s,
boolean inflate)
base64 decodes and inflates the SAML message.
|
String |
samlEncode(String s,
boolean deflate)
Deflates and base64 encodes the SAML message readying it for transport.
|
SamlTransformer |
setImplementation(SpringSecuritySaml implementation) |
String |
toXml(Saml2Object saml2Object)
Converts a SAML object into an XML string.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fromXml
public DefaultSamlTransformer(SpringSecuritySaml implementation)
public SamlTransformer setImplementation(SpringSecuritySaml implementation)
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public String toXml(Saml2Object saml2Object)
toXml
in interface SamlTransformer
saml2Object
- - object to be converted to XMLpublic Saml2Object fromXml(byte[] xml, List<SimpleKey> verificationKeys, List<SimpleKey> localKeys)
fromXml
in interface SamlTransformer
xml
- the XML representation of the objectverificationKeys
- Nullable. If not null, object signature will be validated upon conversion.
The implementation will attempt each key until one succeedslocalKeys
- the configured local private keys. Used for decryption when needed.public String samlEncode(String s, boolean deflate)
samlEncode
in interface SamlTransformer
s
- - original stringdeflate
- - if set to true the DEFLATE encoding will be appliedpublic String samlDecode(String s, boolean inflate)
samlDecode
in interface SamlTransformer
s
- base64 encoded deflated stringinflate
- - if set to true the value will be deflated