# GrapeCity.Documents.Excel.ISignature.Sign

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Excel_ISignature_Sign_" data-uid="GrapeCity.Documents.Excel.ISignature.Sign*">Sign Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Excel_ISignature_Sign_" data-uid="GrapeCity.Documents.Excel.ISignature.Sign*"></a>
<h4 id="GrapeCity_Documents_Excel_ISignature_Sign_System_Security_Cryptography_X509Certificates_X509Certificate2_System_IO_Stream_GrapeCity_Documents_Excel_SignatureDetails_" data-uid="GrapeCity.Documents.Excel.ISignature.Sign(System.Security.Cryptography.X509Certificates.X509Certificate2,System.IO.Stream,GrapeCity.Documents.Excel.SignatureDetails)">Sign(X509Certificate2, Stream, SignatureDetails)</h4>
<div class="markdown level1 summary"><p>Creates a signature packet for visible signature line.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void Sign(X509Certificate2 certificate, Stream signatureImage, SignatureDetails details)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub Sign(certificate As X509Certificate2, signatureImage As Stream, details As SignatureDetails)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2">X509Certificate2</a></td>
      <td><span class="parametername">certificate</span></td>
      <td><p>The certificate that will be used to sign the workbook.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">signatureImage</span></td>
      <td><p>The signature image of the signature line.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Excel.SignatureDetails.html">SignatureDetails</a></td>
      <td><span class="parametername">details</span></td>
      <td><p>The signature detail of the signature.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></td>
      <td><p>Attempted to sign a non-visible signature line.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Excel_ISignature_Sign_" data-uid="GrapeCity.Documents.Excel.ISignature.Sign*"></a>
<h4 id="GrapeCity_Documents_Excel_ISignature_Sign_System_Security_Cryptography_X509Certificates_X509Certificate2_System_String_GrapeCity_Documents_Excel_SignatureDetails_" data-uid="GrapeCity.Documents.Excel.ISignature.Sign(System.Security.Cryptography.X509Certificates.X509Certificate2,System.String,GrapeCity.Documents.Excel.SignatureDetails)">Sign(X509Certificate2, string, SignatureDetails)</h4>
<div class="markdown level1 summary"><p>Creates a signature packet for visible signature line.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void Sign(X509Certificate2 certificate, string signatureText, SignatureDetails details)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub Sign(certificate As X509Certificate2, signatureText As String, details As SignatureDetails)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2">X509Certificate2</a></td>
      <td><span class="parametername">certificate</span></td>
      <td><p>The certificate that will be used to sign the workbook.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">signatureText</span></td>
      <td><p>The signature text of the signature line.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Excel.SignatureDetails.html">SignatureDetails</a></td>
      <td><span class="parametername">details</span></td>
      <td><p>The signature detail of the signature.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></td>
      <td><p>Attempted to sign a non-visible signature line.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Excel_ISignature_Sign_" data-uid="GrapeCity.Documents.Excel.ISignature.Sign*"></a>
<h4 id="GrapeCity_Documents_Excel_ISignature_Sign_System_Security_Cryptography_X509Certificates_X509Certificate2_GrapeCity_Documents_Excel_SignatureDetails_" data-uid="GrapeCity.Documents.Excel.ISignature.Sign(System.Security.Cryptography.X509Certificates.X509Certificate2,GrapeCity.Documents.Excel.SignatureDetails)">Sign(X509Certificate2, SignatureDetails)</h4>
<div class="markdown level1 summary"><p>Creates a signature packet for non-visible signature line.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void Sign(X509Certificate2 certificate, SignatureDetails details)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub Sign(certificate As X509Certificate2, details As SignatureDetails)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2">X509Certificate2</a></td>
      <td><span class="parametername">certificate</span></td>
      <td><p>The certificate that will be used to sign the workbook.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Excel.SignatureDetails.html">SignatureDetails</a></td>
      <td><span class="parametername">details</span></td>
      <td><p>The signature detail of the signature.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></td>
      <td><p>Attempted to sign a visible signature line.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
