public static CRT decode(CRTType type, TLVList data) { ConstructedTLV crtTLV = (ConstructedTLV) data.getByTag(type.getTag()); TLV uqTLV = crtTLV.getContents().getByTag(TAG_UQ); return new CRT( type, UsageQualifier.decode(uqTLV.getData()[0]), CRTKeyRef.decode(crtTLV.getContents().getByTag(TAG_KEYREF).getData())); }
public TLV encodeKeyReference() { PrimitiveTLV tlv = new PrimitiveTLV(TAG_KEYREF); if (keyRef != null) tlv.setData(keyRef.encode()); return tlv; }