[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: pkcs12.py
File is not writable. Editing disabled.
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography import x509 from cryptography.hazmat.backends import _get_backend from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.asymmetric import dsa, ec, rsa def load_key_and_certificates(data, password, backend=None): backend = _get_backend(backend) return backend.load_key_and_certificates_from_pkcs12(data, password) def serialize_key_and_certificates(name, key, cert, cas, encryption_algorithm): if key is not None and not isinstance( key, ( rsa.RSAPrivateKeyWithSerialization, dsa.DSAPrivateKeyWithSerialization, ec.EllipticCurvePrivateKeyWithSerialization, ), ): raise TypeError("Key must be RSA, DSA, or EllipticCurve private key.") if cert is not None and not isinstance(cert, x509.Certificate): raise TypeError("cert must be a certificate") if cas is not None: cas = list(cas) if not all(isinstance(val, x509.Certificate) for val in cas): raise TypeError("all values in cas must be certificates") if not isinstance( encryption_algorithm, serialization.KeySerializationEncryption ): raise TypeError( "Key encryption algorithm must be a " "KeySerializationEncryption instance" ) if key is None and cert is None and not cas: raise ValueError("You must supply at least one of key, cert, or cas") backend = _get_backend(None) return backend.serialize_key_and_certificates_to_pkcs12( name, key, cert, cas, encryption_algorithm )
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server306.web-hosting.com
Server IP: 192.64.117.220
PHP Version: 8.2.31
Server Software: LiteSpeed
System: Linux server306.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
HDD Total: 138.28 GB
HDD Free: 102.3 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: awodbsau
User ID (UID): 4522
Group ID (GID): 4521
Script Owner UID: 4522
Current Dir Owner: N/A