diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /third_party/rust/nss_sys/src/bindings/keythi.rs | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/nss_sys/src/bindings/keythi.rs')
-rw-r--r-- | third_party/rust/nss_sys/src/bindings/keythi.rs | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/third_party/rust/nss_sys/src/bindings/keythi.rs b/third_party/rust/nss_sys/src/bindings/keythi.rs new file mode 100644 index 0000000000..6995e995c1 --- /dev/null +++ b/third_party/rust/nss_sys/src/bindings/keythi.rs @@ -0,0 +1,140 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +use crate::*; +use std::os::raw::{c_int, c_uchar, c_void}; + +pub type SECKEYPublicKey = SECKEYPublicKeyStr; +#[repr(C)] +pub struct SECKEYPublicKeyStr { + pub arena: *mut PLArenaPool, + pub keyType: u32, /* KeyType */ + pub pkcs11Slot: *mut PK11SlotInfo, + pub pkcs11ID: CK_OBJECT_HANDLE, + pub u: SECKEYPublicKeyStr_u, +} + +#[repr(C)] +pub union SECKEYPublicKeyStr_u { + pub rsa: SECKEYRSAPublicKey, + pub dsa: SECKEYDSAPublicKey, + pub dh: SECKEYDHPublicKey, + pub kea: SECKEYKEAPublicKey, + pub fortezza: SECKEYFortezzaPublicKey, + pub ec: SECKEYECPublicKey, +} + +pub type SECKEYPrivateKey = SECKEYPrivateKeyStr; +#[repr(C)] +pub struct SECKEYPrivateKeyStr { + pub arena: *mut PLArenaPool, + pub keyType: u32, /* KeyType */ + pub pkcs11Slot: *mut PK11SlotInfo, + pub pkcs11ID: CK_OBJECT_HANDLE, + pub pkcs11IsTemp: PRBool, + pub wincx: *mut c_void, + pub staticflags: PRUint32, +} + +#[repr(u32)] +pub enum KeyType { + nullKey = 0, + rsaKey = 1, + dsaKey = 2, + fortezzaKey = 3, + dhKey = 4, + keaKey = 5, + ecKey = 6, + rsaPssKey = 7, + rsaOaepKey = 8, +} + +pub type SECKEYRSAPublicKey = SECKEYRSAPublicKeyStr; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct SECKEYRSAPublicKeyStr { + pub arena: *mut PLArenaPool, + pub modulus: SECItem, + pub publicExponent: SECItem, +} + +pub type SECKEYDSAPublicKey = SECKEYDSAPublicKeyStr; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct SECKEYDSAPublicKeyStr { + pub params: SECKEYPQGParams, + pub publicValue: SECItem, +} + +pub type SECKEYPQGParams = SECKEYPQGParamsStr; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct SECKEYPQGParamsStr { + pub arena: *mut PLArenaPool, + pub prime: SECItem, + pub subPrime: SECItem, + pub base: SECItem, +} + +pub type SECKEYDHPublicKey = SECKEYDHPublicKeyStr; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct SECKEYDHPublicKeyStr { + pub arena: *mut PLArenaPool, + pub prime: SECItem, + pub base: SECItem, + pub publicValue: SECItem, +} + +pub type SECKEYKEAPublicKey = SECKEYKEAPublicKeyStr; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct SECKEYKEAPublicKeyStr { + pub params: SECKEYKEAParams, + pub publicValue: SECItem, +} + +pub type SECKEYKEAParams = SECKEYKEAParamsStr; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct SECKEYKEAParamsStr { + pub arena: *mut PLArenaPool, + pub hash: SECItem, +} + +pub type SECKEYFortezzaPublicKey = SECKEYFortezzaPublicKeyStr; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct SECKEYFortezzaPublicKeyStr { + pub KEAversion: c_int, + pub DSSversion: c_int, + pub KMID: [c_uchar; 8usize], + pub clearance: SECItem, + pub KEApriviledge: SECItem, + pub DSSpriviledge: SECItem, + pub KEAKey: SECItem, + pub DSSKey: SECItem, + pub params: SECKEYPQGParams, + pub keaParams: SECKEYPQGParams, +} + +pub type SECKEYECPublicKey = SECKEYECPublicKeyStr; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct SECKEYECPublicKeyStr { + pub DEREncodedParams: SECKEYECParams, + pub size: c_int, + pub publicValue: SECItem, + pub encoding: u32, /* ECPointEncoding */ +} + +pub type SECKEYECParams = SECItem; + +#[repr(u32)] +#[derive(Copy, Clone)] +pub enum ECPointEncoding { + ECPoint_Uncompressed = 0, + ECPoint_XOnly = 1, + ECPoint_Undefined = 2, +} |