java/remoteprovisioning/ProtectedDataPayload.java
/*
   * This function takes the provided eekPrivateKey and uses it to decrypt the CBOR blob which
   * contains the boot certificate chain, MAC key, and device public key.
   *
   * @param cborProtectedData the CBOR encoded byte array representing a ProtectedData object
   *
   * @param challenge the challenge that was retrieved from the CertificateRequest blob. Part of
   *                  the AAD
   *
   * @param deviceInfo the CBOR encoded byte array representing the DeviceInfo blob. Part of the
   *                   AAD
   *
   * @param eek The server X25519 key pair that will be used to decrypt the ProtectedData
   */
This function takes the provided eekPrivateKey and uses it to decrypt the CBOR blob which
contains the boot certificate chain, MAC key, and device public key.

@param cborProtectedData the CBOR encoded byte array representing a ProtectedData object

@param challenge the challenge that was retrieved from the CertificateRequest blob. Part of
the AAD

@param deviceInfo the CBOR encoded byte array representing the DeviceInfo blob. Part of the
AAD

@param eek The server X25519 key pair that will be used to decrypt the ProtectedData
This function takes the provided eekPrivateKey and uses it to decrypt the CBOR blob which contains the boot certificate chain MAC key and device public key . @param cborProtectedData the CBOR encoded byte array representing a ProtectedData object @param challenge the challenge that was retrieved from the CertificateRequest blob . Part of the AAD @param deviceInfo the CBOR encoded byte array representing the DeviceInfo blob . Part of the AAD @param eek The server X25519 key pair that will be used to decrypt the ProtectedData
private void decryptAndValidateProtectedData(
      byte[] cborProtectedData, byte[] challenge, byte[] deviceInfo, byte[] macedKeysMac,
      AsymmetricCipherKeyPair eek)
      throws CborException, CryptoException {
    CBORObject protectedDataPayload = CborUtil.decodeEncryptMessage(cborProtectedData, eek);
    if (protectedDataPayload == null) {
      throw new CborException(
          "Failed to deserialize protected data payload from decrypted data",
          CborException.DESERIALIZATION_ERROR);
    }
    validateProtectedData(
        protectedDataPayload, challenge, deviceInfo, macedKeysMac);
  }
private void decryptAndValidateProtectedData ( byte [ ] cborProtectedData , byte [ ] challenge , byte [ ] deviceInfo , byte [ ] macedKeysMac , AsymmetricCipherKeyPair eek ) throws CborException , CryptoException { CBORObject protectedDataPayload = CborUtil . decodeEncryptMessage ( cborProtectedData , eek ) ; if ( protectedDataPayload == null ) { throw new CborException ( "Failed to deserialize protected data payload from decrypted data" , CborException . DESERIALIZATION_ERROR ) ; } validateProtectedData ( protectedDataPayload , challenge , deviceInfo , macedKeysMac ) ; }
This function takes the provided eekPrivateKey and uses it to decrypt the CBOR blob which
 contains the boot certificate chain, MAC key, and device public key.
This function takes the provided eekPrivateKey and uses it to decrypt the CBOR blob which contains the boot certificate chain MAC key and device public key .