@JRubyMethod(name = { "export", "to_pem", "to_s" }, rest = true)
public IRubyObject export(IRubyObject[] args) {
StringWriter w = new StringWriter();
org.jruby.runtime.Arity.checkArgumentCount(getRuntime(), args, 0, 2);
CipherSpec ciph = null;
char[] passwd = null;
if (args.length > 0 && !args[0].isNil()) {
org.jruby.ext.openssl.Cipher c = (org.jruby.ext.openssl.Cipher) args[0];
ciph = new CipherSpec(c.getCipher(), c.getName(), c.getKeyLen() * 8);
if (args.length > 1 && !args[1].isNil()) {
passwd = args[1].toString().toCharArray();
}
}
try {