in java/cose/CosePartyInfo.java [49:67]
public static CosePartyInfo decode(byte[] data) throws CborException {
DataItem coseParty = CborUtil.cborToDataItem(data);
Array array = CborUtil.asArray(coseParty);
List<DataItem> dataItems = array.getDataItems();
if (dataItems.size() != COSE_PARTY_LENGTH) {
throw new CborException(
String.format(
"Party info has the wrong length \nExpected: %s\nActual: %s",
COSE_PARTY_LENGTH, dataItems.size()));
}
byte[] identity = CborUtil.asByteString(dataItems.get(COSE_PARTY_IDENTITY_INDEX)).getBytes();
byte[] nonce = CborUtil.asByteString(dataItems.get(COSE_PARTY_NONCE_INDEX)).getBytes();
byte[] other = CborUtil.asByteString(dataItems.get(COSE_PARTY_OTHER_INDEX)).getBytes();
return new CosePartyInfo(identity, nonce, other);
}