Subject: Re: [jose] draft-manger-jose-jwsec

From: "Vladimir Dzhuvinov / NimbusDS" <[email-masked]>
Date: Wed, 13 Jun 2012 00:02:15 -0700

Hi James,

What should happen when there is a mismatch between the "S"/"E"/...
prefix and the actual type of the applied algorithm?

Cheers,

Vladimir

--
Vladimir Dzhuvinov : www.NimbusDS.com : [email-masked]

---

From: "Manger, James H" <[email-masked]>
Date: Wed, 13 Jun 2012 17:21:48 +1000

> prefix and the actual type of the applied algorithm?

ERROR: "A128KW" is not a supported signature algorithm

In Java, for instance, if you call
  javax.crypto.Cipher.getInstance("HmacSHA512")
you get
  Exception in thread "main" java.security.NoSuchAlgorithmException: Cannot find any provider supporting HMACSHA512
        at javax.crypto.Cipher.getInstance(DashoA13*..)

JWE/JWS might have encouraged libraries to have one consolidated list of all possible algorithms. I suspect that is a bit unusual, however. I expect most crypto libraries have separate lists for encryption, MAC, digital signature, compression etc algorithms.

With draft-manger-jose-jwsec I don't reuse the "alg" element. I use "kmg" for the key management algorithm identifier when doing encryption and "sig" when signing. If you incorrectly put the "S" prefix on an encrypted JWsec message the error is likely to be:
  ERROR: "sig" element is missing

--
James Manger

---

From: Breno de Medeiros <[email-masked]>
Date: Wed, 13 Jun 2012 00:27:37 -0700

What is the benefit of such approach? Redundant information never helped
write better code or promoted interoperability. The information needed to
process the token is available in the envelope.
On Jun 13, 2012 12:21 AM, "Manger, James H" <[email-masked]>
wrote:

> JWE/JWS might have encouraged libraries to have one consolidated list of
> all possible algorithms. I suspect that is a bit unusual, however. I expect
> most crypto libraries have separate lists for encryption, MAC, digital
> signature, compression etc algorithms.
>
>
> With draft-manger-jose-jwsec I don't reuse the "alg" element. I use "kmg"
> for the key management algorithm identifier when doing encryption and "sig"
> when signing. If you incorrectly put the "S" prefix on an encrypted JWsec
> message the error is likely to be:
> _______________________________________________
> jose mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/jose
>

---

From: Anthony Nadalin <[email-masked]>
Date: Wed, 13 Jun 2012 09:00:14 +0000

That is an implementation specific error as there could have been an alias set prior in JCE

---

From: "Jim Schaad" <[email-masked]>
Date: Sun, 17 Jun 2012 20:17:54 -0700

<no hat>

I think that this question may be of relevance for the current specification
as well.  What happens if I put an encryption algorithm in the alg field but
do signature processing?

Jim

> From: [email-masked] [mailto:[email-masked]] On Behalf Of
> Vladimir Dzhuvinov / NimbusDS
> Sent: Wednesday, June 13, 2012 12:02 AM
> To: Manger, James H
> Cc: [email-masked]