in java/remoteprovisioning/EekCertChainDeserializer.java [77:94]
private static int getSigningAlg(CBORObject certObj) throws CborException {
CborUtil.checkArray(certObj, 4 /* expectedLength */, "SignedEek");
byte[] protectedHeaders = CborUtil.getSafeBstr(certObj.get(0), "SignedEek[0]");
CBORObject protMap = CBORObject.DecodeFromBytes(protectedHeaders);
CborUtil.checkMap(protMap, "Decoded SignedEek[0]");
CBORObject algObj = protMap.get(1);
if (algObj.isNumber()) {
int alg = algObj.AsInt32();
if (alg != -7 && alg != -8) {
throw new CborException("Decoded SignedEek[0] entry for Algorithm is not valid: " + alg,
CborException.DESERIALIZATION_ERROR);
}
return alg;
} else {
throw new CborException("Decoded SignedEek[0] entry for Algorithm is not a number.",
CborException.DESERIALIZATION_ERROR);
}
}