Propiedad Issuer

Microsoft Office Objects

Propiedad Issuer

       

Devuelve un valor String que representa el nombre del emisor del certificado digital que corresponde al objeto Signature. Es de sólo lectura.

expresión.Issuer

expresión   Requerida. Expresión que devuelve uno de los objetos de la lista Aplicar a.

Ejemplo

En el ejemplo siguiente se solicita al usuario que seleccione una firma digital para firmar el documento activo de Microsoft Word. Para utilizar este ejemplo, abra un documento de Word y pase a esta función los nombres de un emisor y de un firmante de certificados en los campos Emitido por y Emitido para de un certificado digital, en el cuadro de diálogo Certificados digitales. Este ejemplo comprueba que la firma digital que el usuario selecciona cumple ciertos criterios, como no haber caducado, antes de que se guarde la firma nueva en el disco.

Function AddSignature(ByVal strIssuer As String, _
    strSigner As String) As Boolean

    On Error GoTo Error_Handler

    Dim sig As Signature

    'Display the dialog box that lets the
    'user select a digital signature.
    'If the user selects a signature, then
    'it is added to the Signatures
    'collection. If the user doesn't, then
    'an error is returned.
    Set sig = ActiveDocument.Signatures.Add

    'Test several properties before commiting the Signature object to disk.
    If sig.Issuer = strIssuer And _
        sig.Signer = strSigner And _
        sig.IsCertificateExpired = False And _
        sig.IsCertificateRevoked = False And _
        sig.IsValid = True Then

        MsgBox "Signed"
        AddSignature = True
    'Otherwise, remove the Signature object from the SignatureSet collection.
    Else
        sig.Delete
        MsgBox "Not signed"
        AddSignature = False
    End If

    'Commit all signatures in the SignatureSet collection to the disk.
    ActiveDocument.Signatures.Commit

    Exit Function
Error_Handler:
    AddSignature = False
    MsgBox "Action cancelled."
End Function