public void setRecipient(GeneralName recipient) {
this.recipient = recipient;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ASN1OutputStream aos = new ASN1OutputStream(baos);
try {
aos.writeObject(recipient);
} catch (IOException e) {
throw new RuntimeException(e);
}
recipientBytes = baos.toByteArray();
}