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 Stringstatic final org.bouncycastle.asn1.ASN1ObjectIdentifier -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthnContextfromExtensions(org.bouncycastle.asn1.x509.Extensions extensions) Creates an instance of the Authentication context extensionstatic AuthnContextfromExtensions(org.bouncycastle.asn1.x509.Extensions extensions, boolean strictMode) Creates an instance of the Authentication context extensionstatic SAMLAuthContextgetAuthnContext(String xml, boolean strictMode) Creates aSAMLAuthContextobject from an xml stringstatic AuthnContextgetInstance(Object obj) Creates an instance of the Authentication context extensionstatic AuthnContextgetInstance(Object obj, boolean strictMode) Creates an instance of the Authentication context extensionstatic StringprintAuthnContext(SAMLAuthContext authnConext, boolean formatted) Converts aSAMLAuthContextobject to XML stringorg.bouncycastle.asn1.ASN1PrimitiveProduce 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:
toASN1Primitivein interfaceorg.bouncycastle.asn1.ASN1Encodable- Specified by:
toASN1Primitivein classorg.bouncycastle.asn1.ASN1Object- Returns:
- ASN.1 object of the extension
-
toString
-
getAuthnContext
Creates aSAMLAuthContextobject from an xml string- Parameters:
xml- xml stringstrictMode- true to strictly enforce content requirement rules- Returns:
SAMLAuthContextobject- Throws:
IOException- on error parsing data
-
printAuthnContext
public static String printAuthnContext(SAMLAuthContext authnConext, boolean formatted) throws IOException Converts aSAMLAuthContextobject to XML string- Parameters:
authnConext-SAMLAuthContextobjectformatted- true to generate pretty printing version- Returns:
- XML string
- Throws:
IOException- on error parsing data
-