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.ObjectAn object used to represent data parsed fromMobileSecurityObjectCBOR 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.PublicKeygetDeviceKey()Gets the mdoc authentication public key set in theMobileSecurityObjectCBOR.java.util.Map<java.lang.String,java.util.List<java.lang.String>>getDeviceKeyAuthorizedDataElements()Gets theAuthorizedDataElementsportion of thekeyAuthorizationswithinDeviceKeyInfo.java.util.List<java.lang.String>getDeviceKeyAuthorizedNameSpaces()Gets theAuthorizedNameSpacesportion of thekeyAuthorizationswithinDeviceKeyInfo.java.util.Map<java.lang.Long,byte[]>getDeviceKeyInfo()Gets extra info for the mdoc authentication public key as part of theKeyInfoportion of theDeviceKeyInfo.java.lang.StringgetDigestAlgorithm()Gets the digest algorithm set in theMobileSecurityObjectCBOR.java.util.Map<java.lang.Long,byte[]>getDigestIDs(java.lang.String namespace)Gets a non-empty mapping between aDigestIDand aDigestfor a particular namespace, as set in the ValueDigests map within theMobileSecurityObjectCBOR.java.lang.StringgetDocType()Gets the document type set in theMobileSecurityObjectCBOR.TimestampgetExpectedUpdate()Gets the timestamp at which the issuing authority infrastructure expects to re-sign the MSO, if provided in theMobileSecurityObjectCBOR, else null.TimestampgetSigned()Gets the timestamp at which the MSO signature was created, as set in theMobileSecurityObjectCBOR.TimestampgetValidFrom()Gets the timestamp before which the MSO is not yet valid, as set in theMobileSecurityObjectCBOR.TimestampgetValidUntil()Gets the timestamp after which the MSO is no longer valid, as set in theMobileSecurityObjectCBOR.java.util.Set<java.lang.String>getValueDigestNamespaces()Gets the set of namespaces provided in the ValueDigests map within theMobileSecurityObjectCBOR.java.lang.StringgetVersion()Gets the version string set in theMobileSecurityObjectCBOR.
-
-
-
Method Detail
-
getVersion
@NonNull public java.lang.String getVersion()
Gets the version string set in theMobileSecurityObjectCBOR.- Returns:
- The version string e.g. "1.0".
-
getDigestAlgorithm
@NonNull public java.lang.String getDigestAlgorithm()
Gets the digest algorithm set in theMobileSecurityObjectCBOR.- Returns:
- The digest algorithm e.g. "SHA-256".
-
getDocType
@NonNull public java.lang.String getDocType()
Gets the document type set in theMobileSecurityObjectCBOR.- 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 theMobileSecurityObjectCBOR.- 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 aDigestIDand aDigestfor a particular namespace, as set in the ValueDigests map within theMobileSecurityObjectCBOR.- 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 theMobileSecurityObjectCBOR.- Returns:
- The public part of the key pair used for mdoc authentication.
-
getDeviceKeyAuthorizedNameSpaces
@Nullable public java.util.List<java.lang.String> getDeviceKeyAuthorizedNameSpaces()
Gets theAuthorizedNameSpacesportion of thekeyAuthorizationswithinDeviceKeyInfo.- 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 theAuthorizedDataElementsportion of thekeyAuthorizationswithinDeviceKeyInfo.- 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 theKeyInfoportion 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 theMobileSecurityObjectCBOR.- 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 theMobileSecurityObjectCBOR.- 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 theMobileSecurityObjectCBOR.- 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 theMobileSecurityObjectCBOR, else null.- Returns:
- The timestamp at which the issuing authority infrastructure expects to re-sign the MSO.
-
-