public static int extractEcdhCurve()

in java/remoteprovisioning/CborUtil.java [142:153]


  public static int extractEcdhCurve(byte[] cborProtectedData) throws CborException {
    CBORObject unprotectedHeadersRecip = getRecipientUnprotectedHeaders(cborProtectedData);
    CBORObject ecdhEpk = unprotectedHeadersRecip.get(HeaderKeys.ECDH_EPK.AsCBOR());
    checkMap(ecdhEpk, "ECDH ephemeral public key");
    CBORObject curve = ecdhEpk.get(KeyKeys.EC2_Curve.AsCBOR());
    if (curve == null || curve.getType() != CBORType.Integer) {
      throw new CborException(
          "Curve on the ECDH ephemeral public key is null or has the wrong type",
          CborException.TYPE_MISMATCH);
    }
    return curve.AsInt32();
  }