[go: nahoru, domu]

blob: e16a6165c564078346a030b74ca7e8ee8ccd78b4 [file] [log] [blame]
Avi Drissman201a9a832022-09-13 19:39:251// Copyright 2020 The Chromium Authors
Michael Ershov1c50ac952020-12-02 21:01:172// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CRYPTO_CHAPS_SUPPORT_H_
6#define CRYPTO_CHAPS_SUPPORT_H_
7
8#include <secmodt.h>
9
10#include "crypto/crypto_export.h"
Michael Ershovd9a627e2021-11-03 13:55:2711#include "crypto/scoped_nss_types.h"
Michael Ershov1c50ac952020-12-02 21:01:1712
13namespace crypto {
14
Michael Ershovd9a627e2021-11-03 13:55:2715// Loads chaps module for this NSS session. Should be called on a worker thread.
Michael Ershov1c50ac952020-12-02 21:01:1716CRYPTO_EXPORT SECMODModule* LoadChaps();
17
Michael Ershovd9a627e2021-11-03 13:55:2718// Returns a slot with `slot_id` from the `chaps_module`. Should be called on a
19// worker thread.
20CRYPTO_EXPORT ScopedPK11Slot GetChapsSlot(SECMODModule* chaps_module,
21 CK_SLOT_ID slot_id);
22
Jun Ishiguroa1404692023-09-19 00:02:4623// Returns true if the given module is the Chaps module. Should be called on a
24// worker thread.
25CRYPTO_EXPORT bool IsChapsModule(SECMODModule* pk11_module);
26
Michael Ershovd9a627e2021-11-03 13:55:2727// Returns true if chaps is the module to which |slot| is attached. Should be
28// called on a worker thread.
Michael Ershov1c50ac952020-12-02 21:01:1729CRYPTO_EXPORT bool IsSlotProvidedByChaps(PK11SlotInfo* slot);
30
31} // namespace crypto
32
33#endif // CRYPTO_CHAPS_SUPPORT_H_