You’re heading the right direction and thanks for taking care of this
module!
A few comments:
to_str, etc.? If so you’ll need to use [DefaultProtocol] attribute or
other appropriate conversions. The easiest way how to find out what
conversions are used in MRI is like so:
class C
def respond_to? name
puts name
false
end
end
RSA.new (C.new, C.new, C.new)
isPrivate) {
You can use RubyEncoder class to encode/decode base64 (ReadBase64,
WriteBase64). It might need some tweaks but that’s all right, feel free
to change it.
instead of byte[]. Byte[] is not a native Ruby type.
especially when you’re throwing them in the same method:
catch (Exception) {
return new RSAParameters();
}
Does Ruby throw any exceptions there? Which?
byte[] modint = { lowbyte, highbyte, 0x00, 0x00 };
count = BitConverter.ToInt32(modint, 0);
count = (lowbyte << 24) | (highbyte << 16)
“elseâ€, “finallyâ€, “catch†etc. right next to closing brace:
if (bt == 0x81) {
count = binr.ReadByte(); // data size in
next byte
} else {
As for compat, I’d target 1.9 first. Write specs and run them against
both MRIs. Then we can decide based upon how much they differ.
Accessors – this is the pattern we currently use:
Tomas
From: [email protected]
[mailto:[email protected]] On Behalf Of Will G.
Sent: Monday, June 21, 2010 5:17 PM
To: ironruby-core
Subject: [Ironruby-core] OpenSSL
Hello, everyone!
After flailing about a bit this weekend with my utter lack of
understanding of cryptography in general, I’ve started work on fleshing
out OpenSSL support. I’ll be working on it here:
http://github.com/hotgazpacho/ironruby/tree/openssl
I’ve written some code, more than I probably should have without specs
first As this is my first stab at writing extensions for IronRuby, I
would appreciate it someone from the core team could take a quick look
at it and make sure I’m headed down the right path.
Now that I have a better handle as to what is going on, I’m going to
proceed with some spec writing, based off of the MRI C code, found here:
Before I get too far, should I be targeting 1.8.7, or something in the
1.9 series? I haven’t checked to see how/if they differ, but I’d like to
target one for now to get a base down, and perform an necessary porting
later.
One more question: When defining Ruby properties, do I need to define a
static C# method for each of the get and set methods, like so:
or is there a way to define a property on an underlying C# object, and
mark it with a single attribute for get and set, like so:
Thanks!
–
Will G.
http://hotgazpacho.org/