Interface AttestationToken


public interface AttestationToken
An AttestationToken represents an RFC 7515 JSON Web Signature or RFC 7519 JSON Web Token as returned from the attestation service.

It can be used to perform additional validations on the data sent from the attestation service beyond the validations normally performed by the attestation SDK if desired.

  • Method Details

    • getBody

      <T> T getBody(Class<T> returnType)
      Retrieves the body of an attestation token.
      Type Parameters:
      T - The type of the body of the token.
      Parameters:
      returnType - The "Type" of the body of the token.
      Returns:
      Returns the deserialized body of the token.
    • serialize

      String serialize()
      Serializes the attestation token as a string.
      Returns:
      Returns the serialized attestation token.
    • getAlgorithm

      String getAlgorithm()
      Returns the "algorithm" token header property. See RFC 7515 section 4.1.1
      Returns:
      The value of the "alg" header parameter.
    • getKeyId

      String getKeyId()
      Returns the "Key ID" token header property. See RFC 7515 section 4.1.4
      Returns:
      The value of the "kid" header parameter.
    • getCertificateChain

      AttestationSigner getCertificateChain()
      Returns the signing certificate chain as an AttestationSigner. See RFC 7515 section 4.1.6 for more information.
      Returns:
      an AttestationSigner encapsulating the certificate chain.
    • getJsonWebKeyUrl

      String getJsonWebKeyUrl()
      Returns a URI which can be used to retrieve a JSON Web Key which can verify the signature on this token. See RFC 7515 section 4.1.5 for more information.
      Returns:
      URI at which a JWK can be retrieved.
    • getJsonWebKey

      AttestationSigner getJsonWebKey()
      Returns the signer for this token if the caller provided a JSON Web Key. See RFC 7515 section 4.1.3 for more information.
      Returns:
      Attestation signer representing the signer of the token.
    • getSha256Thumbprint

      BinaryData getSha256Thumbprint()
      Returns the SHA-256 thumbprint of the leaf certificate in the getCertificateChain. See RFC 7515 section 4.1.8 for more information.
      Returns:
      the SHA-256 thumbprint of the leaf certificate returned by getCertificateChain.
    • getThumbprint

      BinaryData getThumbprint()
      Returns the SHA-1 thumbprint of the leaf certificate in the getCertificateChain. See RFC 7515 section 4.1.7 for more information.
      Returns:
      the SHA-1 thumbprint of the leaf certificate returned by getCertificateChain.
    • getX509Url

      String getX509Url()
      Returns a URI which can be used to retrieve an X.509 certificate which can verify the signature on this token. See RFC 7515 section 4.1.5 for more information.
      Returns:
      URI at which an X.509 certificate can be retrieved.
    • getCritical

      String[] getCritical()
      Returns the "crit" header property from the JSON Web Signature object. See RFC 7515 section 4.1.11 for more information.
      Returns:
      URI at which an X.509 certificate can be retrieved.
    • getType

      String getType()
      Returns the "typ" header property from the JWS. See RFC 7515 section 4.1.9 for more information.
      Returns:
      URI at which an X.509 certificate can be retrieved.
    • getContentType

      String getContentType()
      Returns the "cty" header property of the JWS. See RFC 7515 section 4.1.10 for more information.
      Returns:
      URI at which an X.509 certificate can be retrieved.
    • getIssuer

      String getIssuer()
      Retrieve the issuer of the attestation token. The issuer corresponds to the "iss" claim in a Json Web Token. See RFC 7519 section 4.1.1 for more information. The issuer will always be the same as the attestation service instance endpoint URL.
      Returns:
      the iss value.
    • getIssuedAt

      OffsetDateTime getIssuedAt()
      Get the Issued At property: The time at which the token was issued. The IssuedAt property corresponds to the "iat" claim in a Json Web Token. See RFC 7519 section 4.1.6 for more information.
      Returns:
      the IssuedAt value.
    • getExpiresOn

      OffsetDateTime getExpiresOn()
      Get the ExpiresOn property: The expiration time after which the token is no longer valid. The ExpiresOn property corresponds to the "exp" claim in a Json Web Token. See RFC 7519 section 4.1.4
      Returns:
      the expiration time for the token.
    • getNotBefore

      OffsetDateTime getNotBefore()
      Get the NotBefore property: The time before which a token cannot be considered valid. The ExpiresOn property corresponds to the "exp" claim in a Json Web Token. See RFC 7519 section 4.1.4
      Returns:
      the not-before time for the token.