Ejemplo n.º 1
0
  public static void createPKey(Ruby runtime, RubyModule ossl) {
    RubyModule _PKey = ossl.defineModuleUnder("PKey");
    _PKey.defineAnnotatedMethods(PKeyModule.class);
    // PKey is abstract
    RubyClass _PKeyPkey =
        _PKey.defineClassUnder(
            "PKey", runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
    RubyClass _OpenSSLError = ossl.getClass("OpenSSLError");
    _PKey.defineClassUnder("PKeyError", _OpenSSLError, _OpenSSLError.getAllocator());

    _PKeyPkey.defineAnnotatedMethods(PKey.class);

    PKeyRSA.createPKeyRSA(runtime, _PKey);
    PKeyDSA.createPKeyDSA(runtime, _PKey);
    PKeyDH.createPKeyDH(runtime, _PKey, _PKeyPkey);
  }
Ejemplo n.º 2
0
 @Override
 public void init(Ruby runtime, RubyModule ffi) {
   super.init(runtime, ffi);
   //
   // Hook up the MemoryPointer class if its not already there
   //
   synchronized (ffi) {
     if (ffi.fastGetClass("DynamicLibrary") == null) {
       DynamicLibrary.createDynamicLibraryClass(runtime, ffi);
     }
     if (ffi.fastGetClass("Invoker") == null) {
       JNAInvoker.createInvokerClass(runtime, ffi);
     }
     if (ffi.fastGetClass("VariadicInvoker") == null) {
       JNAVariadicInvoker.createVariadicInvokerClass(runtime, ffi);
     }
     ffi.defineModuleUnder("LastError").defineAnnotatedMethods(LastError.class);
   }
 }