Package se.swedenconnect.cert.extensions
Class AuthnContext
java.lang.Object
org.bouncycastle.asn1.ASN1Object
se.swedenconnect.cert.extensions.AuthnContext
- All Implemented Interfaces:
org.bouncycastle.asn1.ASN1Encodable
,org.bouncycastle.util.Encodable
public class AuthnContext
extends org.bouncycastle.asn1.ASN1Object
AuthnContext X.509 extension implementation for extending Bouncycastle.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final org.bouncycastle.asn1.ASN1ObjectIdentifier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthnContext
fromExtensions
(org.bouncycastle.asn1.x509.Extensions extensions) Creates an instance of the Authentication context extensionstatic AuthnContext
fromExtensions
(org.bouncycastle.asn1.x509.Extensions extensions, boolean strictMode) Creates an instance of the Authentication context extensionstatic SAMLAuthContext
getAuthnContext
(String xml, boolean strictMode) Creates aSAMLAuthContext
object from an xml stringstatic AuthnContext
getInstance
(Object obj) Creates an instance of the Authentication context extensionstatic AuthnContext
getInstance
(Object obj, boolean strictMode) Creates an instance of the Authentication context extensionstatic String
printAuthnContext
(SAMLAuthContext authnConext, boolean formatted) Converts aSAMLAuthContext
object to XML stringorg.bouncycastle.asn1.ASN1Primitive
Produce an object suitable for an ASN1OutputStream.toString()
Methods inherited from class org.bouncycastle.asn1.ASN1Object
encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode
-
Field Details
-
OID
public static final org.bouncycastle.asn1.ASN1ObjectIdentifier OID -
CONTENT_TYPE
- See Also:
-
-
Constructor Details
-
AuthnContext
Constructor- Parameters:
statementInfoList
- list of statement infos
-
-
Method Details
-
getInstance
Creates an instance of the Authentication context extension- Parameters:
obj
- object holding extension data- Returns:
- Authentication context extension
-
getInstance
Creates an instance of the Authentication context extension- Parameters:
obj
- object holding extension datastrictMode
- strict syntax processing- Returns:
- Authentication context extension
-
fromExtensions
Creates an instance of the Authentication context extension- Parameters:
extensions
- Authentication context extension- Returns:
- Authentication context extension
-
fromExtensions
public static AuthnContext fromExtensions(org.bouncycastle.asn1.x509.Extensions extensions, boolean strictMode) Creates an instance of the Authentication context extension- Parameters:
extensions
- Authentication context extensionstrictMode
- strict syntax processing- Returns:
- Authentication context extension
-
toASN1Primitive
public org.bouncycastle.asn1.ASN1Primitive toASN1Primitive()Produce an object suitable for an ASN1OutputStream.AuthenticationContexts ::= SEQUENCE SIZE (1..MAX) OF AuthenticationContext AuthenticationContext ::= SEQUENCE { contextType UTF8String, contextInfo UTF8String OPTIONAL }
- Specified by:
toASN1Primitive
in interfaceorg.bouncycastle.asn1.ASN1Encodable
- Specified by:
toASN1Primitive
in classorg.bouncycastle.asn1.ASN1Object
- Returns:
- ASN.1 object of the extension
-
toString
-
getAuthnContext
Creates aSAMLAuthContext
object from an xml string- Parameters:
xml
- xml stringstrictMode
- true to strictly enforce content requirement rules- Returns:
SAMLAuthContext
object- Throws:
IOException
- on error parsing data
-
printAuthnContext
public static String printAuthnContext(SAMLAuthContext authnConext, boolean formatted) throws IOException Converts aSAMLAuthContext
object to XML string- Parameters:
authnConext
-SAMLAuthContext
objectformatted
- true to generate pretty printing version- Returns:
- XML string
- Throws:
IOException
- on error parsing data
-