IOpcCertificateEnumerator::GetCurrent method (msopc.h)
Gets the CERT_CONTEXT structure at the current position of the enumerator.
Syntax
HRESULT GetCurrent(
[out, retval] const CERT_CONTEXT **certificate
);
Parameters
[out, retval] certificate
A pointer to a CERT_CONTEXT structure. If the method succeeds, call the CertFreeCertificateContext function to free the memory of the structure.
Return value
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Return code/value | Description |
---|---|
|
The method succeeded. |
|
The partReference parameter is NULL. |
|
The enumerator is invalid because the underlying set has changed. |
|
The enumerator cannot perform this operation from its current position. |
|
A relationship whose target is a Signature part has the external target mode; Signature parts must be inside of the package. |
|
A relationship of type digital signature certificate has the external target mode.
For more information about this relationship type, see the OPC. |
|
A Transform element that indicates the use of the relationships transform and the selection criteria for the transform does not conform to the schema specified in the OPC. |
|
The part that contains the certificate and is the target of a relationship of type digital signature certificate does not exist.
For more information about this relationship type, see the OPC. |
|
The SignatureProperty element is missing the required Target attribute. |
|
Either the content type of a part differed from the expected content type (specified in the OPC, ECMA-376 Part 2), or the part content did not match the part's content type. |
Remarks
If the certificate represented by the CERT_CONTEXT structure is corrupted or is not an X.509 certificate, this method will return an error; further, the signing policy used by the caller dictates whether the signature will still be validated. After this kind of error is returned, calls to the MoveNext or MovePrevious method will continue to iterate through the enumerator.
When an enumerator is created, the current position precedes the first pointer of the enumerator. To set the current position to the first pointer, call the MoveNext method after the enumerator is created.
Thread Safety
Packaging objects are not thread-safe.
For more information, see the Getting Started with the Packaging API.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps only] |
Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
Target Platform | Windows |
Header | msopc.h |
See also
Getting Started with the Packaging API
Overviews
Packaging API Programming Guide
Reference