use of org.jruby.ext.openssl.impl.RecipInfo in project jruby-openssl by jruby.
the class PKCS7 method recipients.
@JRubyMethod
public IRubyObject recipients() {
Collection<RecipInfo> sk;
if (p7.isEnveloped()) {
sk = p7.getEnveloped().getRecipientInfo();
} else if (p7.isSignedAndEnveloped()) {
sk = p7.getSignedAndEnveloped().getRecipientInfo();
} else {
sk = null;
}
if (sk == null) {
return getRuntime().newArray();
}
RubyArray ary = getRuntime().newArray(sk.size());
for (RecipInfo ri : sk) {
ary.append(RecipientInfo.create(getRuntime(), ri));
}
return ary;
}
Aggregations