throw new IllegalArgumentException("invalid rid in KeyTransRecipientInformation");
throw new IllegalArgumentException("invalid rid in KeyAgreeRecipientInformation");
    public KeyAgreeRecipientInformation(        KeyAgreeRecipientInfo info,        AlgorithmIdentifier   encAlg,        InputStream data)    {        super(encAlg, AlgorithmIdentifier.getInstance(info.getKeyEncryptionAlgorithm()), data);        _info = info;        _encAlg = encAlg;        try        {            ASN1Sequence s = _info.getRecipientEncryptedKeys();            RecipientEncryptedKey id = RecipientEncryptedKey.getInstance(s.getObjectAt(0));            IssuerAndSerialNumber iAnds = id.getIdentifier().getIssuerAndSerialNumber();            ByteArrayOutputStream bOut = new ByteArrayOutputStream();            ASN1OutputStream aOut = new ASN1OutputStream(bOut);            aOut.writeObject(iAnds.getName());            _rid = new RecipientId();            _rid.setIssuer(bOut.toByteArray());            _rid.setSerialNumber(iAnds.getSerialNumber().getValue());            _encryptedKey = id.getEncryptedKey();        }        catch (IOException e)        {            throw new IllegalArgumentException("invalid rid in KeyTransRecipientInformation");        }    }