pub fn verify_access_token_multiple<T>(
    key: &CoseKey,
    token: &ByteString,
    external_aad: Option<&[u8]>
) -> Result<(), AccessTokenError<T::Error>>where
    T: CoseSignCipher,
Expand description

Verifies the given token and external_aad with the key using the cipher given by type parameter T, returning an error in case it could not be verified.

This method should be used when the given token is a CoseSign rather than CoseSign1 (i.e., if it is intended for a multiple recipients). In case the token is an instance of the latter, use verify_access_token instead.

NOTE: Protected headers are not verified as of now.

Errors

  • When there’s a CoseError while deserializing the given token to a CoseSign structure (e.g., if it’s not in fact a CoseSign structure but rather something else).
  • When there’s a verification error coming from the cipher T (e.g., if the token’s data does not match its signature).