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 protected
IdentityEvidence(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 void
ensureType(IdentityEvidenceType expectedType, net.minidev.json.JSONObject jsonObject)
Ensures thetype
member of the specified JSON object matches the expected.IdentityEvidenceType
getEvidenceType()
Returns the evidence type.static IdentityEvidence
parse(net.minidev.json.JSONObject jsonObject)
Parses an identity evidence from the specified JSON object.IDDocumentEvidence
toIDDocumentEvidence()
Casts this identity evidence to an ID document evidence.net.minidev.json.JSONObject
toJSONObject()
Returns a JSON object representation of this evidence.String
toJSONString()
QESEvidence
toQESEvidence()
Casts this identity evidence to a QES evidence.UtilityBillEvidence
toUtilityBillEvidence()
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:
toJSONString
in 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
,QESEvidence
orUtilityBillEvidence
instance. - 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 thetype
member 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.
-
-