Class MobileSecurityObjectParser.MobileSecurityObject

  • Enclosing class:
    MobileSecurityObjectParser

    public static class MobileSecurityObjectParser.MobileSecurityObject
    extends java.lang.Object
    An object used to represent data parsed from MobileSecurityObject 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 the MobileSecurityObject CBOR.
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getDeviceKeyAuthorizedDataElements()
      Gets the AuthorizedDataElements portion of the keyAuthorizations within DeviceKeyInfo.
      java.util.List<java.lang.String> getDeviceKeyAuthorizedNameSpaces()
      Gets the AuthorizedNameSpaces portion of the keyAuthorizations within DeviceKeyInfo.
      java.util.Map<java.lang.Long,​byte[]> getDeviceKeyInfo()
      Gets extra info for the mdoc authentication public key as part of the KeyInfo portion of the DeviceKeyInfo.
      java.lang.String getDigestAlgorithm()
      Gets the digest algorithm set in the MobileSecurityObject CBOR.
      java.util.Map<java.lang.Long,​byte[]> getDigestIDs​(java.lang.String namespace)
      Gets a non-empty mapping between a DigestID and a Digest for a particular namespace, as set in the ValueDigests map within the MobileSecurityObject CBOR.
      java.lang.String getDocType()
      Gets the document type set in the MobileSecurityObject CBOR.
      Timestamp getExpectedUpdate()
      Gets the timestamp at which the issuing authority infrastructure expects to re-sign the MSO, if provided in the MobileSecurityObject CBOR, else null.
      Timestamp getSigned()
      Gets the timestamp at which the MSO signature was created, as set in the MobileSecurityObject CBOR.
      Timestamp getValidFrom()
      Gets the timestamp before which the MSO is not yet valid, as set in the MobileSecurityObject CBOR.
      Timestamp getValidUntil()
      Gets the timestamp after which the MSO is no longer valid, as set in the MobileSecurityObject CBOR.
      java.util.Set<java.lang.String> getValueDigestNamespaces()
      Gets the set of namespaces provided in the ValueDigests map within the MobileSecurityObject CBOR.
      java.lang.String getVersion()
      Gets the version string set in the MobileSecurityObject CBOR.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getVersion

        @NonNull
        public java.lang.String getVersion()
        Gets the version string set in the MobileSecurityObject CBOR.
        Returns:
        The version string e.g. "1.0".
      • getDigestAlgorithm

        @NonNull
        public java.lang.String getDigestAlgorithm()
        Gets the digest algorithm set in the MobileSecurityObject CBOR.
        Returns:
        The digest algorithm e.g. "SHA-256".
      • getDocType

        @NonNull
        public java.lang.String getDocType()
        Gets the document type set in the MobileSecurityObject 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 the MobileSecurityObject 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 a DigestID and a Digest for a particular namespace, as set in the ValueDigests map within the MobileSecurityObject 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 the MobileSecurityObject CBOR.
        Returns:
        The public part of the key pair used for mdoc authentication.
      • getDeviceKeyAuthorizedNameSpaces

        @Nullable
        public java.util.List<java.lang.String> getDeviceKeyAuthorizedNameSpaces()
        Gets the AuthorizedNameSpaces portion of the keyAuthorizations within DeviceKeyInfo.
        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 the AuthorizedDataElements portion of the keyAuthorizations within DeviceKeyInfo.
        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 the KeyInfo portion of the DeviceKeyInfo.
        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 the MobileSecurityObject 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 the MobileSecurityObject 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 the MobileSecurityObject 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 the MobileSecurityObject CBOR, else null.
        Returns:
        The timestamp at which the issuing authority infrastructure expects to re-sign the MSO.