Package com.android.identity
Class MobileSecurityObjectParser.MobileSecurityObject
- java.lang.Object
-
- com.android.identity.MobileSecurityObjectParser.MobileSecurityObject
-
- Enclosing class:
- MobileSecurityObjectParser
public static class MobileSecurityObjectParser.MobileSecurityObject extends java.lang.Object
An object used to represent data parsed fromMobileSecurityObject
CBOR as specified in ISO/IEC 18013-5 section 9.1.2 Issuer data authentication
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.security.PublicKey
getDeviceKey()
Gets the mdoc authentication public key set in theMobileSecurityObject
CBOR.java.util.Map<java.lang.String,java.util.List<java.lang.String>>
getDeviceKeyAuthorizedDataElements()
Gets theAuthorizedDataElements
portion of thekeyAuthorizations
withinDeviceKeyInfo
.java.util.List<java.lang.String>
getDeviceKeyAuthorizedNameSpaces()
Gets theAuthorizedNameSpaces
portion of thekeyAuthorizations
withinDeviceKeyInfo
.java.util.Map<java.lang.Long,byte[]>
getDeviceKeyInfo()
Gets extra info for the mdoc authentication public key as part of theKeyInfo
portion of theDeviceKeyInfo
.java.lang.String
getDigestAlgorithm()
Gets the digest algorithm set in theMobileSecurityObject
CBOR.java.util.Map<java.lang.Long,byte[]>
getDigestIDs(java.lang.String namespace)
Gets a non-empty mapping between aDigestID
and aDigest
for a particular namespace, as set in the ValueDigests map within theMobileSecurityObject
CBOR.java.lang.String
getDocType()
Gets the document type set in theMobileSecurityObject
CBOR.Timestamp
getExpectedUpdate()
Gets the timestamp at which the issuing authority infrastructure expects to re-sign the MSO, if provided in theMobileSecurityObject
CBOR, else null.Timestamp
getSigned()
Gets the timestamp at which the MSO signature was created, as set in theMobileSecurityObject
CBOR.Timestamp
getValidFrom()
Gets the timestamp before which the MSO is not yet valid, as set in theMobileSecurityObject
CBOR.Timestamp
getValidUntil()
Gets the timestamp after which the MSO is no longer valid, as set in theMobileSecurityObject
CBOR.java.util.Set<java.lang.String>
getValueDigestNamespaces()
Gets the set of namespaces provided in the ValueDigests map within theMobileSecurityObject
CBOR.java.lang.String
getVersion()
Gets the version string set in theMobileSecurityObject
CBOR.
-
-
-
Method Detail
-
getVersion
@NonNull public java.lang.String getVersion()
Gets the version string set in theMobileSecurityObject
CBOR.- Returns:
- The version string e.g. "1.0".
-
getDigestAlgorithm
@NonNull public java.lang.String getDigestAlgorithm()
Gets the digest algorithm set in theMobileSecurityObject
CBOR.- Returns:
- The digest algorithm e.g. "SHA-256".
-
getDocType
@NonNull public java.lang.String getDocType()
Gets the document type set in theMobileSecurityObject
CBOR.- Returns:
- The document type e.g. "org.iso.18013.5.1.mDL".
-
getValueDigestNamespaces
@NonNull public java.util.Set<java.lang.String> getValueDigestNamespaces()
Gets the set of namespaces provided in the ValueDigests map within theMobileSecurityObject
CBOR.- Returns:
- The set of namespaces provided in the ValueDigests map.
-
getDigestIDs
@Nullable public java.util.Map<java.lang.Long,byte[]> getDigestIDs(@NonNull java.lang.String namespace)
Gets a non-empty mapping between aDigestID
and aDigest
for a particular namespace, as set in the ValueDigests map within theMobileSecurityObject
CBOR.- Parameters:
namespace
- The namespace of interest.- Returns:
- The mapping present for that namespace if it exists within the ValueDigests, else null.
-
getDeviceKey
@NonNull public java.security.PublicKey getDeviceKey()
Gets the mdoc authentication public key set in theMobileSecurityObject
CBOR.- Returns:
- The public part of the key pair used for mdoc authentication.
-
getDeviceKeyAuthorizedNameSpaces
@Nullable public java.util.List<java.lang.String> getDeviceKeyAuthorizedNameSpaces()
Gets theAuthorizedNameSpaces
portion of thekeyAuthorizations
withinDeviceKeyInfo
.- Returns:
- The list of namespaces which should be given authorization, null if it does not exist in the MSO.
-
getDeviceKeyAuthorizedDataElements
@Nullable public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getDeviceKeyAuthorizedDataElements()
Gets theAuthorizedDataElements
portion of thekeyAuthorizations
withinDeviceKeyInfo
.- Returns:
- A mapping from namespaces to a list of
DataElementIdentifier
, null if it does not exist in the MSO.
-
getDeviceKeyInfo
@Nullable public java.util.Map<java.lang.Long,byte[]> getDeviceKeyInfo()
Gets extra info for the mdoc authentication public key as part of theKeyInfo
portion of theDeviceKeyInfo
.- Returns:
- A mapping to represent additional key information, null if it does not exist in the MSO.
-
getSigned
@NonNull public Timestamp getSigned()
Gets the timestamp at which the MSO signature was created, as set in theMobileSecurityObject
CBOR.- Returns:
- The timestamp at which the MSO signature was created.
-
getValidFrom
@NonNull public Timestamp getValidFrom()
Gets the timestamp before which the MSO is not yet valid, as set in theMobileSecurityObject
CBOR.- Returns:
- The timestamp before which the MSO is not yet valid.
-
getValidUntil
@NonNull public Timestamp getValidUntil()
Gets the timestamp after which the MSO is no longer valid, as set in theMobileSecurityObject
CBOR.- Returns:
- The timestamp after which the MSO is no longer valid.
-
getExpectedUpdate
@Nullable public Timestamp getExpectedUpdate()
Gets the timestamp at which the issuing authority infrastructure expects to re-sign the MSO, if provided in theMobileSecurityObject
CBOR, else null.- Returns:
- The timestamp at which the issuing authority infrastructure expects to re-sign the MSO.
-
-