use of org.jruby.ext.openssl.impl.SignerInfoWithPkey in project jruby-openssl by jruby.
the class PKCS7 method signers.
/**
* ossl_pkcs7_get_signer
*
* This seems to return a list of SignerInfo objects.
*/
@JRubyMethod
public IRubyObject signers() {
Collection<SignerInfoWithPkey> signerInfos = p7.getSignerInfo();
RubyArray ary = getRuntime().newArray(signerInfos.size());
for (SignerInfoWithPkey signerInfo : signerInfos) {
ary.append(SignerInfo.create(getRuntime(), signerInfo));
}
return ary;
}
use of org.jruby.ext.openssl.impl.SignerInfoWithPkey in project jruby-openssl by jruby.
the class PKCS7 method add_signer.
@JRubyMethod
public IRubyObject add_signer(IRubyObject obj) {
SignerInfoWithPkey signedInfo = ((SignerInfo) obj).getSignerInfo().dup();
try {
p7.addSigner(signedInfo);
} catch (PKCS7Exception e) {
throw newPKCS7Error(getRuntime(), e);
}
if (p7.isSigned()) {
ASN1Encodable objectId = org.jruby.ext.openssl.impl.PKCS7.OID_pkcs7_data;
signedInfo.addSignedAttribute(ASN1Registry.NID_pkcs9_contentType, objectId);
}
return this;
}
Aggregations