@@ -234,7 +234,7 @@ public void encrypt() throws CoseException, Exception {
234234 byte [] rgbAPU = new byte [256 /8 ];
235235 random = new SecureRandom ();
236236 random .nextBytes (rgbAPU );
237- addAttribute (HeaderKeys .HKDF_Context_PartyU_nonce .AsCBOR (), CBORObject .FromObject (rgbAPU ), Attribute .UnprotectedAttributes );
237+ addAttribute (HeaderKeys .HKDF_Context_PartyU_nonce .AsCBOR (), CBORObject .FromObject (rgbAPU ), Attribute .UNPROTECTED );
238238 }
239239 rgbKey = ECDH_GenerateSecret (privateKey );
240240 rgbKey = HKDF (rgbKey , 128 , AlgorithmID .AES_KW_128 , new SHA256Digest ());
@@ -255,7 +255,7 @@ public void encrypt() throws CoseException, Exception {
255255 byte [] rgbAPU = new byte [256 /8 ];
256256 random = new SecureRandom ();
257257 random .nextBytes (rgbAPU );
258- addAttribute (HeaderKeys .HKDF_Context_PartyU_nonce .AsCBOR (), CBORObject .FromObject (rgbAPU ), Attribute .UnprotectedAttributes );
258+ addAttribute (HeaderKeys .HKDF_Context_PartyU_nonce .AsCBOR (), CBORObject .FromObject (rgbAPU ), Attribute .UNPROTECTED );
259259 }
260260 rgbKey = ECDH_GenerateSecret (privateKey );
261261 rgbKey = HKDF (rgbKey , 192 , AlgorithmID .AES_KW_192 , new SHA256Digest ());
@@ -276,7 +276,7 @@ public void encrypt() throws CoseException, Exception {
276276 byte [] rgbAPU = new byte [256 /8 ];
277277 random = new SecureRandom ();
278278 random .nextBytes (rgbAPU );
279- addAttribute (HeaderKeys .HKDF_Context_PartyU_nonce .AsCBOR (), CBORObject .FromObject (rgbAPU ), Attribute .UnprotectedAttributes );
279+ addAttribute (HeaderKeys .HKDF_Context_PartyU_nonce .AsCBOR (), CBORObject .FromObject (rgbAPU ), Attribute .UNPROTECTED );
280280 }
281281 rgbKey = ECDH_GenerateSecret (privateKey );
282282 rgbKey = HKDF (rgbKey , 256 , AlgorithmID .AES_KW_256 , new SHA256Digest ());
@@ -365,7 +365,7 @@ public byte[] getKey(AlgorithmID algCEK) throws CoseException, Exception {
365365 byte [] rgbAPU = new byte [256 /8 ];
366366 random = new SecureRandom ();
367367 random .nextBytes (rgbAPU );
368- addAttribute (HeaderKeys .HKDF_Context_PartyU_nonce .AsCBOR (), CBORObject .FromObject (rgbAPU ), Attribute .UnprotectedAttributes );
368+ addAttribute (HeaderKeys .HKDF_Context_PartyU_nonce .AsCBOR (), CBORObject .FromObject (rgbAPU ), Attribute .UNPROTECTED );
369369 }
370370 rgbSecret = ECDH_GenerateSecret (privateKey );
371371 return HKDF (rgbSecret , algCEK .getKeySize (), algCEK , new SHA256Digest ());
@@ -376,7 +376,7 @@ public byte[] getKey(AlgorithmID algCEK) throws CoseException, Exception {
376376 byte [] rgbAPU = new byte [512 /8 ];
377377 random = new SecureRandom ();
378378 random .nextBytes (rgbAPU );
379- addAttribute (HeaderKeys .HKDF_Context_PartyU_nonce .AsCBOR (), CBORObject .FromObject (rgbAPU ), Attribute .UnprotectedAttributes );
379+ addAttribute (HeaderKeys .HKDF_Context_PartyU_nonce .AsCBOR (), CBORObject .FromObject (rgbAPU ), Attribute .UNPROTECTED );
380380 }
381381 rgbSecret = ECDH_GenerateSecret (privateKey );
382382 return HKDF (rgbSecret , algCEK .getKeySize (), algCEK , new SHA512Digest ());
@@ -466,7 +466,7 @@ private void ECDH_GenerateEphemeral() throws CoseException
466466 System .arraycopy (rgbEncoded , 1 , X , 0 , X .length );
467467 epk .Add (KeyKeys .EC2_X .AsCBOR (), CBORObject .FromObject (X ));
468468 epk .Add (KeyKeys .EC2_Y .AsCBOR (), CBORObject .FromObject ((rgbEncoded [0 ] & 1 ) == 1 ));
469- AddUnprotected (HeaderKeys .ECDH_EPK , epk );
469+ addAttribute (HeaderKeys .ECDH_EPK , epk , Attribute . UNPROTECTED );
470470
471471 OneKey secretKey = new OneKey ();
472472 secretKey .add (KeyKeys .KeyType , KeyKeys .KeyType_EC2 );
0 commit comments