blob: eb754335316d56238ddece63a759c92e1c4373d8 [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
23// Returns true if chaps is the module to which |slot| is attached. Should be
24// called on a worker thread.
Michael Ershov1c50ac952020-12-02 21:01:1725CRYPTO_EXPORT bool IsSlotProvidedByChaps(PK11SlotInfo* slot);
26
27} // namespace crypto
28
29#endif // CRYPTO_CHAPS_SUPPORT_H_