本文整理汇总了C++中ObjectType::qualifyingProperties方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectType::qualifyingProperties方法的具体用法?C++ ObjectType::qualifyingProperties怎么用?C++ ObjectType::qualifyingProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectType
的用法示例。
在下文中一共展示了ObjectType::qualifyingProperties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void digidoc::dsig::operator<< (DOMElement &e, const ObjectType &i)
{
e << static_cast<const ObjectTypeBase&>(i);
for(ObjectType::QualifyingPropertiesConstIterator b = i.qualifyingProperties().begin();
b != i.qualifyingProperties().end(); ++b)
{
DOMElement &s(
xsd::cxx::xml::dom::create_element("QualifyingProperties", "http://uri.etsi.org/01903/v1.3.2#", e));
s << *b;
}
}
示例2: signedInfo
/**
* Creates an empty BDOC-BES signature with mandatory XML nodes.
*/
SignatureBES::SignatureBES(unsigned int id, BDoc *bdoc, Signer *signer)
: signature(0)
, asicsignature(0)
, bdoc(bdoc)
{
string nr = "S" + to_string(id);
// Signature->SignedInfo
SignedInfoType signedInfo(Uri(/*URI_ID_EXC_C14N_NOC*/URI_ID_C14N11_NOC), Uri(URI_ID_RSA_SHA256));
// Signature->SignatureValue
SignatureValueType signatureValue;
signatureValue.id(nr + "-SIG");
// Signature (root)
asicsignature = new XAdESSignaturesType();
asicsignature->signature().push_back(SignatureType(signedInfo, signatureValue));
signature = &asicsignature->signature()[0];
signature->id(nr);
// Signature->Object->QualifyingProperties->SignedProperties
SignedPropertiesType signedProperties;
signedProperties.signedSignatureProperties(SignedSignaturePropertiesType());
signedProperties.id(nr + "-SignedProperties");
if(signer->profile().find(BDoc::ASIC_TM_PROFILE) != string::npos)
{
map<string,Policy>::const_iterator p = policylist.cbegin();
IdentifierType identifierid(p->first);
identifierid.qualifier(QualifierType::OIDAsURN);
ObjectIdentifierType identifier(identifierid);
identifier.description(p->second.DESCRIPTION);
string digestUri = Conf::instance()->digestUri();
const vector<unsigned char> *data = &p->second.SHA256;
if(Conf::instance()->digestUri() == URI_SHA224) data = &p->second.SHA224;
else if(Conf::instance()->digestUri() == URI_SHA256) data = &p->second.SHA256;
else if(Conf::instance()->digestUri() == URI_SHA384) data = &p->second.SHA384;
else if(Conf::instance()->digestUri() == URI_SHA512) data = &p->second.SHA512;
DigestAlgAndValueType policyDigest(DigestMethodType(digestUri),
Base64Binary(&data->front(), data->size()));
SignaturePolicyIdType policyId(identifier, policyDigest);
SigPolicyQualifiersListType::SigPolicyQualifierType uri;
uri.sPURI(p->second.URI);
SigPolicyQualifiersListType qualifiers;
qualifiers.sigPolicyQualifier().push_back(uri);
policyId.sigPolicyQualifiers(qualifiers);
SignaturePolicyIdentifierType policyidentifier;
policyidentifier.signaturePolicyId(policyId);
signedProperties.signedSignatureProperties()->signaturePolicyIdentifier(policyidentifier);
}
// Signature->Object->QualifyingProperties
QualifyingPropertiesType qualifyingProperties("#" + nr);
qualifyingProperties.signedProperties(signedProperties);
// Signature->Object
ObjectType object;
object.qualifyingProperties().push_back(qualifyingProperties);
signature->object().push_back(object);
//Fill XML-DSIG/XAdES properties
X509Cert c = signer->cert();
setSigningCertificate(c);
signature->signedInfo().signatureMethod(Uri( X509Crypto(c).rsaModulus().empty() ?
Digest::toEcUri(signer->method()) : Digest::toRsaUri(signer->method()) ));
setSignatureProductionPlace(signer->city(), signer->stateOrProvince(), signer->postalCode(), signer->countryName());
setSignerRoles(signer->signerRoles());
time_t t = time(0);
setSigningTime(gmtime(&t));
string digestMethod = Conf::instance()->digestUri();
for(const DataFile *f: bdoc->dataFiles())
{
string id = addReference(File::toUriPath(f->fileName()), digestMethod, f->calcDigest(digestMethod), "");
addDataObjectFormat("#" + id, f->mediaType());
}
Digest calc(digestMethod);
calcDigestOnNode(&calc, XADES_NAMESPACE, "SignedProperties");
addReference("#" + nr +"-SignedProperties", calc.uri(), calc.result(), "http://uri.etsi.org/01903#SignedProperties");
}