Class IdentityEvidence
- java.lang.Object
-
- com.nimbusds.openid.connect.sdk.assurance.evidences.IdentityEvidence
-
- All Implemented Interfaces:
net.minidev.json.JSONAware
- Direct Known Subclasses:
IDDocumentEvidence,QESEvidence,UtilityBillEvidence
public abstract class IdentityEvidence extends Object implements net.minidev.json.JSONAware
The base abstract class for identity evidences.Related specifications:
- OpenID Connect for Identity Assurance 1.0, section 4.1.1.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedIdentityEvidence(IdentityEvidenceType evidenceType)Creates a new evidence with the specified type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static voidensureType(IdentityEvidenceType expectedType, net.minidev.json.JSONObject jsonObject)Ensures thetypemember of the specified JSON object matches the expected.IdentityEvidenceTypegetEvidenceType()Returns the evidence type.static IdentityEvidenceparse(net.minidev.json.JSONObject jsonObject)Parses an identity evidence from the specified JSON object.IDDocumentEvidencetoIDDocumentEvidence()Casts this identity evidence to an ID document evidence.net.minidev.json.JSONObjecttoJSONObject()Returns a JSON object representation of this evidence.StringtoJSONString()QESEvidencetoQESEvidence()Casts this identity evidence to a QES evidence.UtilityBillEvidencetoUtilityBillEvidence()Casts this identity evidence to a utility bill evidence.
-
-
-
Constructor Detail
-
IdentityEvidence
protected IdentityEvidence(IdentityEvidenceType evidenceType)
Creates a new evidence with the specified type.- Parameters:
evidenceType- The evidence type. Must not benull.
-
-
Method Detail
-
getEvidenceType
public IdentityEvidenceType getEvidenceType()
Returns the evidence type.- Returns:
- The evidence type.
-
toIDDocumentEvidence
public IDDocumentEvidence toIDDocumentEvidence()
Casts this identity evidence to an ID document evidence.- Returns:
- The ID document evidence.
-
toUtilityBillEvidence
public UtilityBillEvidence toUtilityBillEvidence()
Casts this identity evidence to a utility bill evidence.- Returns:
- The utility bill evidence.
-
toQESEvidence
public QESEvidence toQESEvidence()
Casts this identity evidence to a QES evidence.- Returns:
- The QES evidence.
-
toJSONObject
public net.minidev.json.JSONObject toJSONObject()
Returns a JSON object representation of this evidence.- Returns:
- The JSON object.
-
toJSONString
public String toJSONString()
- Specified by:
toJSONStringin interfacenet.minidev.json.JSONAware
-
parse
public static IdentityEvidence parse(net.minidev.json.JSONObject jsonObject) throws ParseException
Parses an identity evidence from the specified JSON object.- Parameters:
jsonObject- The JSON object. Must not benull.- Returns:
- A
IDDocumentEvidence,QESEvidenceorUtilityBillEvidenceinstance. - Throws:
ParseException- If parsing failed or the evidence type isn't supported.
-
ensureType
protected static void ensureType(IdentityEvidenceType expectedType, net.minidev.json.JSONObject jsonObject) throws ParseException
Ensures thetypemember of the specified JSON object matches the expected.- Parameters:
expectedType- The expected type. Must not benull.jsonObject- The JSON object. Must not benull.- Throws:
ParseException- If parsing failed or mismatch.
-
-