libcryptosec
Classes | Public Member Functions | Static Public Member Functions | Static Protected Attributes | List of all members
Pkcs7SignedData Class Reference

#include <Pkcs7SignedData.h>

Inheritance diagram for Pkcs7SignedData:
Pkcs7

Classes

struct  VERIFY_ERROR
 

Public Member Functions

 Pkcs7SignedData (PKCS7 *pkcs7) throw (Pkcs7Exception)
 
virtual ~Pkcs7SignedData ()
 
virtual Pkcs7::Type getType ()
 
std::vector< Certificate * > getCertificates ()
 
std::vector< CertificateRevocationList * > getCrls ()
 
bool verify (bool checkSignerCert=false, vector< Certificate > trusted=vector< Certificate >(), CertPathValidatorResult **cpvr=NULL, vector< ValidationFlags > flags=vector< ValidationFlags >())
 
bool verifyAndExtract (std::ostream *out) throw (Pkcs7Exception)
 
- Public Member Functions inherited from Pkcs7
 Pkcs7 (PKCS7 *pkcs7)
 
virtual ~Pkcs7 ()
 
std::string getPemEncoded () throw (EncodeException)
 
ByteArray getDerEncoded () throw (EncodeException)
 

Static Public Member Functions

static int callback (int ok, X509_STORE_CTX *ctx)
 

Static Protected Attributes

static CertPathValidatorResult cpvr
 

Additional Inherited Members

- Public Types inherited from Pkcs7
enum  Type { SIGNED, ENVELOPED, CERTIFICATE_BUNDLE }
 
- Protected Attributes inherited from Pkcs7
PKCS7 * pkcs7
 

Detailed Description

Representa um pacote PKCS7 assinado.

Constructor & Destructor Documentation

◆ Pkcs7SignedData()

Pkcs7SignedData::Pkcs7SignedData ( PKCS7 *  pkcs7)
throw (Pkcs7Exception
)

Construtor padrão recebendo um ponteiro para a estrutura OpenSSL PKCS7. Uma cópia rasa do objeto (struct) é feita, logo o ponteiro deve já ter sido alocado.

Parameters
pkcs7um ponteiro para a estrutura OpenSSL PKCS7
Exceptions
Pkcs7Exceptioncaso o ponteiro não contenha o endereço de uma estrutura PKCS7 válida.

◆ ~Pkcs7SignedData()

Pkcs7SignedData::~Pkcs7SignedData ( )
virtual

Destrutor padrão, limpa a estrutura PKCS7 aninhada.

Member Function Documentation

◆ callback()

int Pkcs7SignedData::callback ( int  ok,
X509_STORE_CTX *  ctx 
)
static

◆ getCertificates()

std::vector< Certificate * > Pkcs7SignedData::getCertificates ( )

Retorna a lista de certificados que assinaram esse pacote.

Returns
a lista de certificados que assinaram o documento.

◆ getCrls()

std::vector< CertificateRevocationList * > Pkcs7SignedData::getCrls ( )

Retorna uma lista com as crls inclusas nesse pacote.

Returns
uma lista com as crls inclusas nesse pacote.

◆ getType()

Pkcs7::Type Pkcs7SignedData::getType ( )
virtual

Implementa o método abstrato Pkcs7::getType(). Retorna Pkcs7::SIGNED

Returns
o tipo de pacote PKCS7, no caso Pkcs7::SIGNED

Implements Pkcs7.

◆ verify()

bool Pkcs7SignedData::verify ( bool  checkSignerCert = false,
vector< Certificate trusted = vector<Certificate>(),
CertPathValidatorResult **  cpvr = NULL,
vector< ValidationFlags flags = vector<ValidationFlags>() 
)

Verifica a integridade do pacote PKCS7.

Returns
false se o pacote tiver sido corrompido, true caso contrário.

◆ verifyAndExtract()

bool Pkcs7SignedData::verifyAndExtract ( std::ostream *  out)
throw (Pkcs7Exception
)

Verifica a integridade do pacote PKCS7 e extrai seu conteúdo para o stream de saída passado como parâmetro.

Parameters
outo stream que receberá o conteúdo extraído.
Returns
false se o pacote tiver sido corrompido, true caso contrário.
Exceptions
Pkcs7Exceptioncaso a estrutura PKCS7 seja inválida.

Member Data Documentation

◆ cpvr

CertPathValidatorResult Pkcs7SignedData::cpvr
staticprotected

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