Package M2Crypto :: Module X509 :: Class Request
[frames] | no frames]

Class Request



X509 Certificate Request.

Instance Methods
 
m2_x509_req_free(...)
 
__init__(self, req=None, _pyfree=0)
 
__del__(self)
 
as_text(self)
 
as_pem(self)
 
as_der(self)
 
save_pem(self, filename)
 
save(self, filename, format=1)
Saves X.509 certificate request to a file.
EVP_PKEY
get_pubkey(self)
Get the public key for the request.
int
set_pubkey(self, pkey)
Set the public key for the request.
int
get_version(self)
Get version.
int
set_version(self, version)
Set version.
 
get_subject(self)
 
set_subject_name(self, name)
Set subject name.
 
set_subject(self, name)
Set subject name.
 
add_extensions(self, ext_stack)
Add X509 extensions to this request.
 
verify(self, pkey)
 
sign(self, pkey, md)
Method Details

save(self, filename, format=1)

 

Saves X.509 certificate request to a file. Default output format is PEM.

Parameters:
  • filename (string) - Name of the file the request will be saved to.
  • format (int) - Controls what output format is used to save the request. Either FORMAT_PEM or FORMAT_DER to save in PEM or DER format. Raises ValueError if an unknown format is used.

get_pubkey(self)

 

Get the public key for the request.

Returns: EVP_PKEY
Public key from the request.

set_pubkey(self, pkey)

 

Set the public key for the request.

Parameters:
  • pkey (EVP_PKEY) - Public key
Returns: int
Return 1 for success and 0 for failure.

get_version(self)

 

Get version.

Returns: int
Returns version.

set_version(self, version)

 

Set version.

Parameters:
  • version (int) - Version number.
Returns: int
Returns 0 on failure.

set_subject_name(self, name)

 

Set subject name.

Parameters:
  • name (X509_Name) - subjectName field.

set_subject(self, name)

 

Set subject name.

Parameters:
  • name (X509_Name) - subjectName field.

add_extensions(self, ext_stack)

 

Add X509 extensions to this request.

Parameters:
  • ext_stack (X509_Extension_Stack) - Stack of extensions to add.