Sha256: fa854a3450923198a234aa8c4869eee5f2a1047b59850270423b116ae03fa0c6

Contents?: true

Size: 1.55 KB

Versions: 4

Compression:

Stored size: 1.55 KB

Contents

#include "xmlsecrb.h"

VALUE rb_cNokogiri_XML_Document = Qnil;
VALUE rb_cNokogiri_XML_Node = Qnil;
VALUE rb_eSigningError = Qnil;
VALUE rb_eVerificationError = Qnil;
VALUE rb_eKeystoreError = Qnil;
VALUE rb_eEncryptionError = Qnil;
VALUE rb_eDecryptionError = Qnil;

void Init_Nokogiri_ext() {
  VALUE XMLSec = rb_define_module("XMLSec");
  VALUE Nokogiri = rb_define_module("Nokogiri");
  VALUE Nokogiri_XML = rb_define_module_under(Nokogiri, "XML");
  rb_cNokogiri_XML_Document = rb_const_get(Nokogiri_XML, rb_intern("Document"));
  rb_cNokogiri_XML_Node = rb_const_get(Nokogiri_XML, rb_intern("Node"));

  rb_define_method(rb_cNokogiri_XML_Node,     "sign!",            sign, 1);
  rb_define_method(rb_cNokogiri_XML_Node,     "verify_with",      verify_with, 1);
  rb_define_method(rb_cNokogiri_XML_Node,     "encrypt_with_key", encrypt_with_key, 3);
  rb_define_method(rb_cNokogiri_XML_Node,     "decrypt_with_key", decrypt_with_key, 2);
  rb_define_method(rb_cNokogiri_XML_Document, "get_id",           get_id, 1);
  rb_define_method(rb_cNokogiri_XML_Node,     "set_id_attribute", set_id_attribute, 1);

  rb_eSigningError      = rb_define_class_under(XMLSec, "SigningError",      rb_eRuntimeError);
  rb_eVerificationError = rb_define_class_under(XMLSec, "VerificationError", rb_eRuntimeError);
  rb_eKeystoreError     = rb_define_class_under(XMLSec, "KeystoreError",     rb_eRuntimeError);
  rb_eEncryptionError   = rb_define_class_under(XMLSec, "EncryptionError",   rb_eRuntimeError);
  rb_eDecryptionError   = rb_define_class_under(XMLSec, "DecryptionError",   rb_eRuntimeError);
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nokogiri-xmlsec-instructure-0.10.2 ext/nokogiri_ext_xmlsec/nokogiri_init.c
nokogiri-xmlsec-instructure-0.10.1 ext/nokogiri_ext_xmlsec/nokogiri_init.c
nokogiri-xmlsec-instructure-0.10.0 ext/nokogiri_ext_xmlsec/nokogiri_init.c
nokogiri-xmlsec-instructure-0.9.7 ext/nokogiri_ext_xmlsec/nokogiri_init.c