LibreOffice Module svl (master) 1
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
svl::crypto::Signing Class Reference

Helper to cryptographically sign and verify arbitrary data blocks. More...

#include <cryptosign.hxx>

Public Member Functions

 Signing (css::uno::Reference< css::security::XCertificate > xCertificate)
 
void AddDataRange (const void *pData, sal_Int32 size)
 Add a range to sign. More...
 
void SetSignTSA (const OUString &tsa)
 
void SetSignPassword (const OUString &password)
 
bool Sign (OStringBuffer &rCMSHexBuffer)
 Signs one or more data blocks (as a single, contiguous, array). More...
 

Static Public Member Functions

static bool Verify (const std::vector< unsigned char > &aData, const bool bNonDetached, const std::vector< unsigned char > &aSignature, SignatureInformation &rInformation)
 Verify and get Signature Information given a byte array. More...
 
static bool Verify (SvStream &rStream, const std::vector< std::pair< size_t, size_t > > &aByteRanges, const bool bNonDetached, const std::vector< unsigned char > &aSignature, SignatureInformation &rInformation)
 Verify and get Signature Information given a signature and stream. More...
 

Private Attributes

const css::uno::Reference< css::security::XCertificate > m_xCertificate
 The certificate to use for signing. More...
 
std::vector< std::pair< const void *, sal_Int32 > > m_dataBlocks
 Data blocks (pointer-size pairs). More...
 
OUString m_aSignTSA
 
OUString m_aSignPassword
 

Detailed Description

Helper to cryptographically sign and verify arbitrary data blocks.

Definition at line 48 of file cryptosign.hxx.

Constructor & Destructor Documentation

◆ Signing()

svl::crypto::Signing::Signing ( css::uno::Reference< css::security::XCertificate >  xCertificate)
inline

Definition at line 52 of file cryptosign.hxx.

Member Function Documentation

◆ AddDataRange()

void svl::crypto::Signing::AddDataRange ( const void *  pData,
sal_Int32  size 
)
inline

Add a range to sign.

Note: for efficiency this takes a naked pointer, which must remain valid until this object is discarded.

Definition at line 60 of file cryptosign.hxx.

References pData, and size.

◆ SetSignPassword()

void svl::crypto::Signing::SetSignPassword ( const OUString &  password)
inline

Definition at line 66 of file cryptosign.hxx.

◆ SetSignTSA()

void svl::crypto::Signing::SetSignTSA ( const OUString &  tsa)
inline

Definition at line 65 of file cryptosign.hxx.

◆ Sign()

bool svl::crypto::Signing::Sign ( OStringBuffer &  rCMSHexBuffer)

◆ Verify() [1/2]

bool svl::crypto::Signing::Verify ( const std::vector< unsigned char > &  aData,
const bool  bNonDetached,
const std::vector< unsigned char > &  aSignature,
SignatureInformation rInformation 
)
static

◆ Verify() [2/2]

bool svl::crypto::Signing::Verify ( SvStream rStream,
const std::vector< std::pair< size_t, size_t > > &  aByteRanges,
const bool  bNonDetached,
const std::vector< unsigned char > &  aSignature,
SignatureInformation rInformation 
)
static

Verify and get Signature Information given a signature and stream.

Definition at line 2346 of file cryptosign.cxx.

References SvStream::ReadBytes(), SvStream::Seek(), size, and Verify().

Member Data Documentation

◆ m_aSignPassword

OUString svl::crypto::Signing::m_aSignPassword
private

Definition at line 92 of file cryptosign.hxx.

Referenced by Sign().

◆ m_aSignTSA

OUString svl::crypto::Signing::m_aSignTSA
private

Definition at line 91 of file cryptosign.hxx.

Referenced by Sign().

◆ m_dataBlocks

std::vector<std::pair<const void*, sal_Int32> > svl::crypto::Signing::m_dataBlocks
private

Data blocks (pointer-size pairs).

Definition at line 90 of file cryptosign.hxx.

Referenced by Sign().

◆ m_xCertificate

const css::uno::Reference<css::security::XCertificate> svl::crypto::Signing::m_xCertificate
private

The certificate to use for signing.

Definition at line 87 of file cryptosign.hxx.

Referenced by Sign().


The documentation for this class was generated from the following files: