coseSign1Sign
Creates a COSE_Sign1 signature.
By default, the Cose.COSE_LABEL_ALG header is included in the protected header with the non-fully-defined Algorithm set of the key. For example for a key with Algorithm.ESP256, the value Algorithm.ES256 is included. If protectedHeaders already contain Cose.COSE_LABEL_ALG it will not be replaced.
The app can include additional headers, for example if certification is needed, Cose.COSE_LABEL_X5CHAIN can be included in either the unprotected or protected header.
This function signs with a key in a Secure Area, for signing with a software-based EcPrivateKey, see the other function with the same name but taking a EcPrivateKey instead.
Parameters
the SecureArea holding the private key.
the alias for the private key to use to sign with.
the data to sign.
whether to include the message in the COSE_Sign1 payload.
the protected headers to include.
the unprotected headers to include.
a KeyUnlockData for unlocking the key in the SecureArea.
Creates a COSE_Sign1 signature.
By default, no headers are added. Applications likely want to include Cose.COSE_LABEL_ALG in the protected header and if certification is needed, Cose.COSE_LABEL_X5CHAIN in either the unprotected or protected header.
This function signs with a software-based EcPrivateKey, for using a key in a Secure Area see the other function with the same name but taking a SecureArea and alias.
Parameters
the private key to sign with.
the data to sign.
whether to include the message in the COSE_Sign1 payload.
the signature algorithm to use.
the protected headers to include.
the unprotected headers to include.