Package M2Crypto :: Module m2
[frames] | no frames]

Module m2



M2Crypto low level OpenSSL wrapper functions.

m2 is the low level wrapper for OpenSSL functions. Typically you would not need to use these directly, since these will be called by the higher level objects you should try to use instead.

Naming conventions: All functions wrapped by m2 are all lower case, words separated by underscores.

Examples:

OpenSSL M2Crypto

X509_get_version m2.x509_get_version X509_get_notBefore m2.x509_get_not_before X509_REQ_verify m2.x509_req_verify

Exceptions to naming rules:

XXX TDB

Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.

Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2004 OSAF. All Rights Reserved.

Variables
  AES_BLOCK_SIZE = 16
  ASN1_STRFLGS_DUMP_DER = 512
  ASN1_STRFLGS_DUMP_UNKNOWN = 256
  ASN1_STRFLGS_ESC_2253 = 1
  ASN1_STRFLGS_ESC_CTRL = 2
  ASN1_STRFLGS_ESC_MSB = 4
  ASN1_STRFLGS_ESC_QUOTE = 8
  ASN1_STRFLGS_RFC2253 = 791
  ASN1_STRFLGS_UTF8_CONVERT = 16
  BIO_FLAGS_IO_SPECIAL = 4
  BIO_FLAGS_MEM_RDONLY = 512
  BIO_FLAGS_READ = 1
  BIO_FLAGS_RWS = 7
  BIO_FLAGS_SHOULD_RETRY = 8
  BIO_FLAGS_WRITE = 2
  DH_GENERATOR_2 = 2
  DH_GENERATOR_5 = 5
  ENGINE_METHOD_ALL = 65535
  ENGINE_METHOD_CIPHERS = 64
  ENGINE_METHOD_DH = 4
  ENGINE_METHOD_DIGESTS = 128
  ENGINE_METHOD_DSA = 2
  ENGINE_METHOD_ECDH = 16
  ENGINE_METHOD_ECDSA = 32
  ENGINE_METHOD_NONE = 0
  ENGINE_METHOD_RAND = 8
  ENGINE_METHOD_RSA = 1
  ENGINE_METHOD_STORE = 256
  NID_X9_62_c2pnb163v1 = 684
  NID_X9_62_c2pnb163v2 = 685
  NID_X9_62_c2pnb163v3 = 686
  NID_X9_62_c2pnb176v1 = 687
  NID_X9_62_c2pnb208w1 = 693
  NID_X9_62_c2pnb272w1 = 699
  NID_X9_62_c2pnb304w1 = 700
  NID_X9_62_c2pnb368w1 = 702
  NID_X9_62_c2tnb191v1 = 688
  NID_X9_62_c2tnb191v2 = 689
  NID_X9_62_c2tnb191v3 = 690
  NID_X9_62_c2tnb239v1 = 694
  NID_X9_62_c2tnb239v2 = 695
  NID_X9_62_c2tnb239v3 = 696
  NID_X9_62_c2tnb359v1 = 701
  NID_X9_62_c2tnb431r1 = 703
  NID_X9_62_prime192v1 = 409
  NID_X9_62_prime192v2 = 410
  NID_X9_62_prime192v3 = 411
  NID_X9_62_prime239v1 = 412
  NID_X9_62_prime239v2 = 413
  NID_X9_62_prime239v3 = 414
  NID_X9_62_prime256v1 = 415
  NID_commonName = 13
  NID_countryName = 14
  NID_givenName = 99
  NID_ipsec3 = 749
  NID_ipsec4 = 750
  NID_localityName = 15
  NID_md5 = 4
  NID_organizationName = 17
  NID_organizationalUnitName = 18
  NID_pkcs9_emailAddress = 48
  NID_ripemd160 = 117
  NID_secp112r1 = 704
  NID_secp112r2 = 705
  NID_secp128r1 = 706
  NID_secp128r2 = 707
  NID_secp160k1 = 708
  NID_secp160r1 = 709
  NID_secp160r2 = 710
  NID_secp192k1 = 711
  NID_secp224k1 = 712
  NID_secp224r1 = 713
  NID_secp256k1 = 714
  NID_secp384r1 = 715
  NID_secp521r1 = 716
  NID_sect113r1 = 717
  NID_sect113r2 = 718
  NID_sect131r1 = 719
  NID_sect131r2 = 720
  NID_sect163k1 = 721
  NID_sect163r1 = 722
  NID_sect163r2 = 723
  NID_sect193r1 = 724
  NID_sect193r2 = 725
  NID_sect233k1 = 726
  NID_sect233r1 = 727
  NID_sect239k1 = 728
  NID_sect283k1 = 729
  NID_sect283r1 = 730
  NID_sect409k1 = 731
  NID_sect409r1 = 732
  NID_sect571k1 = 733
  NID_sect571r1 = 734
  NID_serialNumber = 105
  NID_sha1 = 64
  NID_sha224 = 675
  NID_sha256 = 672
  NID_sha384 = 673
  NID_sha512 = 674
  NID_stateOrProvinceName = 16
  NID_surname = 100
  NID_wap_wsg_idm_ecid_wtls1 = 735
  NID_wap_wsg_idm_ecid_wtls10 = 743
  NID_wap_wsg_idm_ecid_wtls11 = 744
  NID_wap_wsg_idm_ecid_wtls12 = 745
  NID_wap_wsg_idm_ecid_wtls3 = 736
  NID_wap_wsg_idm_ecid_wtls4 = 737
  NID_wap_wsg_idm_ecid_wtls5 = 738
  NID_wap_wsg_idm_ecid_wtls6 = 739
  NID_wap_wsg_idm_ecid_wtls7 = 740
  NID_wap_wsg_idm_ecid_wtls8 = 741
  NID_wap_wsg_idm_ecid_wtls9 = 742
  OPENSSL_NO_EC = 0
  OPENSSL_VERSION_NUMBER = 9470079
  OPENSSL_VERSION_PTEXT = ' part of OpenSSL 0.9.8g 19 Oct 2007'
  OPENSSL_VERSION_TEXT = 'OpenSSL 0.9.8g 19 Oct 2007'
  PKCS5_SALT_LEN = 8
  PKCS7_BINARY = 128
  PKCS7_DATA = 21
  PKCS7_DETACHED = 64
  PKCS7_ENVELOPED = 23
  PKCS7_NOATTR = 256
  PKCS7_NOCERTS = 2
  PKCS7_NOCHAIN = 8
  PKCS7_NOINTERN = 16
  PKCS7_NOSIGS = 4
  PKCS7_NOVERIFY = 32
  PKCS7_SIGNED = 22
  PKCS7_SIGNED_ENVELOPED = 24
  PKCS7_TEXT = 1
  RSA_3 = 3
  RSA_F4 = 65537
  SHLIB_VERSION_HISTORY = ''
  SHLIB_VERSION_NUMBER = '0.9.8'
  SSL_CB_ACCEPT_EXIT = 8194
  SSL_CB_ACCEPT_LOOP = 8193
  SSL_CB_ALERT = 16384
  SSL_CB_CONNECT_EXIT = 4098
  SSL_CB_CONNECT_LOOP = 4097
  SSL_CB_EXIT = 2
  SSL_CB_HANDSHAKE_DONE = 32
  SSL_CB_HANDSHAKE_START = 16
  SSL_CB_LOOP = 1
  SSL_CB_READ = 4
  SSL_CB_READ_ALERT = 16388
  SSL_CB_WRITE = 8
  SSL_CB_WRITE_ALERT = 16392
  SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER = 1
  SSL_MODE_AUTO_RETRY = 4
  SSL_MODE_ENABLE_PARTIAL_WRITE = 1
  SSL_OP_ALL = 4095
  SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = 2048
  SSL_OP_NO_SSLv2 = 16777216
  SSL_OP_NO_SSLv3 = 33554432
  SSL_OP_NO_TLSv1 = 67108864
  SSL_RECEIVED_SHUTDOWN = 2
  SSL_SENT_SHUTDOWN = 1
  SSL_SESS_CACHE_BOTH = 3
  SSL_SESS_CACHE_CLIENT = 1
  SSL_SESS_CACHE_OFF = 0
  SSL_SESS_CACHE_SERVER = 2
  SSL_ST_ACCEPT = 8192
  SSL_ST_BEFORE = 16384
  SSL_ST_CONNECT = 4096
  SSL_ST_INIT = 12288
  SSL_ST_MASK = 4095
  SSL_ST_OK = 3
  SSL_ST_RENEGOTIATE = 12292
  SSL_VERIFY_CLIENT_ONCE = 4
  SSL_VERIFY_FAIL_IF_NO_PEER_CERT = 2
  SSL_VERIFY_NONE = 0
  SSL_VERIFY_PEER = 1
  X509V3_EXT_DEFAULT = 0
  X509V3_EXT_DUMP_UNKNOWN = 196608
  X509V3_EXT_ERROR_UNKNOWN = 65536
  X509V3_EXT_PARSE_UNKNOWN = 131072
  X509V3_EXT_UNKNOWN_MASK = 983040
  X509_PURPOSE_ANY = 7
  X509_PURPOSE_CRL_SIGN = 6
  X509_PURPOSE_NS_SSL_SERVER = 3
  X509_PURPOSE_OCSP_HELPER = 8
  X509_PURPOSE_SMIME_ENCRYPT = 5
  X509_PURPOSE_SMIME_SIGN = 4
  X509_PURPOSE_SSL_CLIENT = 1
  X509_PURPOSE_SSL_SERVER = 2
  X509_TRUST_COMPAT = 1
  X509_TRUST_DEFAULT = -1
  X509_TRUST_DYNAMIC = 1
  X509_TRUST_DYNAMIC_NAME = 2
  X509_TRUST_EMAIL = 4
  X509_TRUST_OBJECT_SIGN = 5
  X509_TRUST_OCSP_REQUEST = 7
  X509_TRUST_OCSP_SIGN = 6
  X509_TRUST_REJECTED = 2
  X509_TRUST_SSL_CLIENT = 2
  X509_TRUST_SSL_SERVER = 3
  X509_TRUST_TRUSTED = 1
  X509_TRUST_UNTRUSTED = 3
  X509_V_ERR_APPLICATION_VERIFICATION = 50
  X509_V_ERR_CERT_CHAIN_TOO_LONG = 22
  X509_V_ERR_CERT_HAS_EXPIRED = 10
  X509_V_ERR_CERT_NOT_YET_VALID = 9
  X509_V_ERR_CERT_REJECTED = 28
  X509_V_ERR_CERT_REVOKED = 23
  X509_V_ERR_CERT_SIGNATURE_FAILURE = 7
  X509_V_ERR_CERT_UNTRUSTED = 27
  X509_V_ERR_CRL_HAS_EXPIRED = 12
  X509_V_ERR_CRL_NOT_YET_VALID = 11
  X509_V_ERR_CRL_SIGNATURE_FAILURE = 8
  X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT = 18
  X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD = 14
  X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = 13
  X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD = 15
  X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = 16
  X509_V_ERR_INVALID_CA = 24
  X509_V_ERR_INVALID_PURPOSE = 26
  X509_V_ERR_OUT_OF_MEM = 17
  X509_V_ERR_PATH_LENGTH_EXCEEDED = 25
  X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN = 19
  X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY = 6
  X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE = 4
  X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE = 5
  X509_V_ERR_UNABLE_TO_GET_CRL = 3
  X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT = 2
  X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY = 20
  X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE = 21
  X509_V_OK = 0
  XN_FLAG_COMPAT = 0
  XN_FLAG_DN_REV = 1048576
  XN_FLAG_DUMP_UNKNOWN_FIELDS = 16777216
  XN_FLAG_FN_ALIGN = 33554432
  XN_FLAG_FN_LN = 2097152
  XN_FLAG_MULTILINE = 44302342
  XN_FLAG_ONELINE = 8520479
  XN_FLAG_RFC2253 = 17892119
  XN_FLAG_SEP_COMMA_PLUS = 65536
  XN_FLAG_SEP_CPLUS_SPC = 131072
  XN_FLAG_SEP_MULTILINE = 262144
  XN_FLAG_SPC_EQ = 8388608
  bio_close = 1
  bio_noclose = 0
  cvar = <Swig global variables>
  decrypt = 0
  dh_check_bad_g = 8
  dh_check_g_failed = 4
  dh_check_ok = 0
  dh_check_p_not_prime = 1
  dh_check_p_not_strong = 2
  encrypt = 1
  no_padding = 3
  pkcs1_oaep_padding = 4
  pkcs1_padding = 1
  ssl_error_none = 0
  ssl_error_ssl = 1
  ssl_error_syscall = 5
  ssl_error_want_connect = 7
  ssl_error_want_read = 2
  ssl_error_want_write = 3
  ssl_error_want_x509_lookup = 4
  ssl_error_zero_return = 6
  sslv23_padding = 2