Search in sources :

Example 1 with RecipInfo

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;
}
Also used : RecipInfo(org.jruby.ext.openssl.impl.RecipInfo) RubyArray(org.jruby.RubyArray) JRubyMethod(org.jruby.anno.JRubyMethod)

Aggregations

RubyArray (org.jruby.RubyArray)1 JRubyMethod (org.jruby.anno.JRubyMethod)1 RecipInfo (org.jruby.ext.openssl.impl.RecipInfo)1