scapy.layers.tls.crypto.pkcs1
PKCS #1 methods as defined in RFC 3447.
We cannot rely solely on the cryptography library, because the openssl package used by the cryptography library may not implement the md5-sha1 hash, as with Ubuntu or OSX. This is why we reluctantly keep some legacy crypto here.
- scapy.layers.tls.crypto.pkcs1.pkcs_i2osp(n, sLen)[source]
I2OSP conversion function from RFC 3447. The length parameter allows the function to perform the padding needed. Note that the user is responsible for providing a sufficient xLen.
- Parameters
n – nonnegative integer to be converted
sLen – intended length of the resulting octet string
- Returns
corresponding octet string