+def create(dotted,shortname,longname):
+ """
+ Creates new OID in the database
+
+ @param dotted - dotted-decimal representation of new OID
+ @param shortname - short name for new OID
+ @param longname - long name for new OID
+
+ @returns Oid object corresponding to new OID
+
+ This function should be used with exreme care. Whenever
+ possible, it is better to add new OIDs via OpenSSL configuration
+ file
+
+ Results of calling this function twice for same OIDor for
+ Oid alredy in database are undefined
+ """
+ nid=libcrypto.OBJ_create(dotted,shortname,longname)
+ if nid == 0:
+ raise LibCryptoError("Problem adding new OID to the database")
+ return Oid(nid)
+
+def cleanup():
+ """
+ Removes all the objects, dynamically added by current
+ application from database.
+ """
+ libcrypto.OBJ_cleanup()
+
+libcrypto.OBJ_nid2sn.restype=c_char_p
+libcrypto.OBJ_nid2ln.restype=c_char_p
+libcrypto.OBJ_nid2obj.restype=c_void_p
+libcrypto.OBJ_obj2txt.argtypes=(c_char_p,c_int,c_void_p,c_int)
+libcrypto.OBJ_txt2nid.argtupes=(c_char_p,)
+libcrypto.OBJ_create.argtypes=(c_char_p,c_char_p,c_char_p)