IPWorks Encrypt 2020 Python Edition

Questions / Feedback?

DSA Class

Properties   Methods   Events   Configuration Settings   Errors  

The DSA (Digital Signature Algorithm) class enables users to generate DSA hash signatures.

Syntax

class ipworksencrypt.DSA

Remarks

The DSA (Digital Signature Algorithm) class enables users to generate DSA hash signatures.

To begin you must either specify an existing key or create a new key. Existing private keys may be specified by setting the Key* properties. To create a new key call create_key. Alternatively an existing certificate may be specified by setting the Certificate* properties

Signing

To sign data first set key or certificate. Select the input file by setting input_file or input_message. Next call sign. The sign method will automatically compute the hash, and then sign the hash with the specified key.

Send the public key (see create_key for details), file, and hash_signature to the recipient.

To sign a hash without recomputing the hash simply set hash_value to the pre-computed hash value before calling sign.

Signature Verification

To verify a signature specify the input data using input_file or input_message. Set signer_key or signer_cert. Next set hash_signature and call verify_signature. The verify_signature method will return True if the signature was successfully verified.

To verify a hash signature without recomputing the hash simply set hash_value to the pre-computed hash value before calling verify_signature.

Hash Notes

The class will determine whether or not to recompute the hash based on the properties that are set. If a file is specified by input_file or input_message the hash will be recomputed when calling sign or verify_signature. If the hash_value property is set the class will only sign the hash or verify the hash signature. Setting input_file or input_message clears the hash_value property. Setting the hash_value property clears the input file selection.

DSA Key Notes

A DSA key is made up of a number of individual parameters. When calling create_key the Key* properties are populated with a new private and public key.

After calling sign the public key must be sent to the recipient along with hash_signature so they may perform signature verification. Likewise you must obtain the public key along with hash_signature in order to perform signature verification.

The public key consists of the following parameters:

The class also includes the key_public_key property which holds the PEM formatted public key for ease of use. This is helpful if you are in control of both signature creation and verification process. When sending the public key to a recipient note that not all implementations will support using the PEM formatted value in key_public_key in which case the individual parameters must be sent.

The private key consists of the following parameters:

The class also include the key_private_key property which holds the PEM formatted private key for ease of use. This is helpful for storing the private key more easily..

Property List


The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

cert_encodedThe certificate (PEM/base64 encoded).
cert_storeThe name of the certificate store for the client certificate.
cert_store_passwordIf the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
cert_store_typeThe type of certificate store for this certificate.
cert_subjectThe subject of the certificate used for client authentication.
hash_algorithmThe hash algorithm used for hash computation.
hash_signatureThe hash signature.
hash_valueThe hash value of the data.
input_fileThe file to process.
input_messageThe message to process.
keygRepresents the G parameter for the DSA algorithm.
keypRepresents the P parameter for the DSA algorithm.
key_private_keyThis property is a PEM formatted private key.
key_public_keyThis property is a PEM formatted public key.
keyqRepresents the Q parameter for the DSA algorithm.
keyxRepresents the X parameter for the DSA algorithm.
keyyRepresents the Y parameter for the DSA algorithm.
signer_cert_encodedThe certificate (PEM/base64 encoded).
signer_cert_storeThe name of the certificate store for the client certificate.
signer_cert_store_passwordIf the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
signer_cert_store_typeThe type of certificate store for this certificate.
signer_cert_subjectThe subject of the certificate used for client authentication.
signer_keygRepresents the G parameter for the DSA algorithm.
signer_keypRepresents the P parameter for the DSA algorithm.
signer_key_public_keyThis property is a PEM formatted public key.
signer_keyqRepresents the Q parameter for the DSA algorithm.
signer_keyyRepresents the Y parameter for the DSA algorithm.
use_hexWhether HashValue and HashSignature are hex encoded.

Method List


The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

configSets or retrieves a configuration setting.
create_keyCreates a new key.
resetResets the class.
signCreates a hash signature.
verify_signatureVerifies the signature for the specified data.

Event List


The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.

on_errorInformation about errors during data delivery.
on_progressFired as progress is made.

Configuration Settings


The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.

HashSignatureFormatThe format of the HashSignature.
KeyFormatHow the public and private key are formatted.
KeySizeThe size, in bits, of the secret key.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
ProcessIdleEventsWhether the class uses its internal event loop to process events when the main thread is idle.
SelectWaitMillisThe length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.
UseInternalSecurityAPITells the class whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Encrypt 2020 Python Edition - Version 20.0 [Build 8155]