java/remoteprovisioning/ProtectedDataPayload.java
/*
   * Verifies the provided CBORObject as a proper certificate chain and then extracts and returns
   * the device public key. The CBOR blob is described by the following CDDL:
   *
   * @param bcc the boot certificate chain which contains DK_pub
   *
   * @return OneKey DK_pub in a COSE key object
   */
Verifies the provided CBORObject as a proper certificate chain and then extracts and returns
the device public key. The CBOR blob is described by the following CDDL.

@param bcc the boot certificate chain which contains DK_pub

@return OneKey DK_pub in a COSE key object
Verifies the provided CBORObject as a proper certificate chain and then extracts and returns the device public key . The CBOR blob is described by the following CDDL . @param bcc the boot certificate chain which contains DK_pub @return OneKey DK_pub in a COSE key object
private OneKey verifyBccAndExtractDevicePublicKey(CBORObject bcc)
      throws CborException, CryptoException {
    CborUtil.checkArrayMinLength(bcc, BCC_LENGTH_MINIMUM, "BCC");
    CborUtil.checkMap(bcc.get(BCC_DEVICE_PUBLIC_KEY_INDEX), "First entry in the BCC");
    if (!CryptoUtil.validateBcc(bcc)) {
      throw new CryptoException(
          "Failed to verify certificate chain", CryptoException.VERIFICATION_FAILURE);
    }
    try {
      return new OneKey(bcc.get(BCC_DEVICE_PUBLIC_KEY_INDEX));
    } catch (CoseException e) {
      throw new CborException(
          "Failed to decode the certificate containing the device public key",
          e,
          CborException.DESERIALIZATION_ERROR);
    }
  }
private OneKey verifyBccAndExtractDevicePublicKey ( CBORObject bcc ) throws CborException , CryptoException { CborUtil . checkArrayMinLength ( bcc , BCC_LENGTH_MINIMUM , "BCC" ) ; CborUtil . checkMap ( bcc . get ( BCC_DEVICE_PUBLIC_KEY_INDEX ) , "First entry in the BCC" ) ; if ( ! CryptoUtil . validateBcc ( bcc ) ) { throw new CryptoException ( "Failed to verify certificate chain" , CryptoException . VERIFICATION_FAILURE ) ; } try { return new OneKey ( bcc . get ( BCC_DEVICE_PUBLIC_KEY_INDEX ) ) ; } catch ( CoseException e ) { throw new CborException ( "Failed to decode the certificate containing the device public key" , e , CborException . DESERIALIZATION_ERROR ) ; } }
Verifies the provided CBORObject as a proper certificate chain and then extracts and returns
 the device public key.
Verifies the provided CBORObject as a proper certificate chain and then extracts and returns the device public key .
// verify the certificate chain // Extract and return the public key