# C1.Pdf.PdfSecurity

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Pdf_PdfSecurity" data-uid="C1.Pdf.PdfSecurity" class="text-break">PdfSecurity Class
</h1>
  <div class="markdown level0 summary"><p>Provides security and encryption services and manages permissions for
<a class="xref" href="C1.Pdf.C1PdfDocument.html">C1PdfDocument</a> objects.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">PdfSecurity</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Pdf.html">C1.Pdf</a></h6>
  <h6><strong>Assembly</strong>: C1.Pdf.dll</h6>
  <h5 id="C1_Pdf_PdfSecurity_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class PdfSecurity : IDisposable</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class PdfSecurity
    Implements IDisposable</code></pre>
  </div>
  <h5 id="C1_Pdf_PdfSecurity_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><pre><code>&lt;p&gt;
    &lt;xref href=&quot;C1.Pdf.PdfSecurity&quot; data-throw-if-not-resolved=&quot;false&quot;&gt;&lt;/xref&gt; has properties that allow you to specify 
</code></pre>
<p>owner and user passwords for a Pdf document. The <a class="xref" href="C1.Pdf.PdfSecurity.OwnerPassword.html#C1_Pdf_PdfSecurity_OwnerPassword">OwnerPassword</a>
is required to change passwords and permissions. The <a class="xref" href="C1.Pdf.PdfSecurity.UserPassword.html#C1_Pdf_PdfSecurity_UserPassword">UserPassword</a>
is required to open the document.</p>
<p>
<a class="xref" href="C1.Pdf.PdfSecurity.html">PdfSecurity</a> also has properties that allow you to specify
what permissions a regular user should have. For example, you may allow users
to see the document but not to print or edit it.</p>
<p>You can specify permissions and set only the <a class="xref" href="C1.Pdf.PdfSecurity.OwnerPassword.html#C1_Pdf_PdfSecurity_OwnerPassword">OwnerPassword</a>,
leaving the <a class="xref" href="C1.Pdf.PdfSecurity.UserPassword.html#C1_Pdf_PdfSecurity_UserPassword">UserPassword</a> empty. In this case, anyone will be
allowed to open the document, but only the owner will be allowed to change
the permissions. </p>
<p>Note that the encryption scheme used by Pdf is public and is not 100%
secure. There are ways to crack encrypted Pdf documents. The security provided
is adequate to protect your documents from most casual attacks, but if your
data is truly sensitive you should not rely on Pdf encryption alone.</p>
</div>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Pdf_PdfSecurity_AllowCopyContent" data-uid="C1.Pdf.PdfSecurity.AllowCopyContent">
          <a class="xref" href="C1.Pdf.PdfSecurity.AllowCopyContent.html#C1_Pdf_PdfSecurity_AllowCopyContent">AllowCopyContent</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets whether the user can copy contents from the PDF document.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Pdf_PdfSecurity_AllowEditAnnotations" data-uid="C1.Pdf.PdfSecurity.AllowEditAnnotations">
          <a class="xref" href="C1.Pdf.PdfSecurity.AllowEditAnnotations.html#C1_Pdf_PdfSecurity_AllowEditAnnotations">AllowEditAnnotations</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets whether the user can edit annotations in the PDF document.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Pdf_PdfSecurity_AllowEditContent" data-uid="C1.Pdf.PdfSecurity.AllowEditContent">
          <a class="xref" href="C1.Pdf.PdfSecurity.AllowEditContent.html#C1_Pdf_PdfSecurity_AllowEditContent">AllowEditContent</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets whether the user can edit the contents of the PDF document.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Pdf_PdfSecurity_AllowPrint" data-uid="C1.Pdf.PdfSecurity.AllowPrint">
          <a class="xref" href="C1.Pdf.PdfSecurity.AllowPrint.html#C1_Pdf_PdfSecurity_AllowPrint">AllowPrint</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets whether the user can print the PDF document.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Pdf_PdfSecurity_Encryption" data-uid="C1.Pdf.PdfSecurity.Encryption">
          <a class="xref" href="C1.Pdf.PdfSecurity.Encryption.html#C1_Pdf_PdfSecurity_Encryption">Encryption</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the type of encryption used for PDF security.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Pdf_PdfSecurity_OwnerPassword" data-uid="C1.Pdf.PdfSecurity.OwnerPassword">
          <a class="xref" href="C1.Pdf.PdfSecurity.OwnerPassword.html#C1_Pdf_PdfSecurity_OwnerPassword">OwnerPassword</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the password required to change permissions for the PDF document.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Pdf_PdfSecurity_SignedTime" data-uid="C1.Pdf.PdfSecurity.SignedTime">
          <a class="xref" href="C1.Pdf.PdfSecurity.SignedTime.html#C1_Pdf_PdfSecurity_SignedTime">SignedTime</a>
        </td>
        <td class="markdown level1 summary"><p>Gets universal signed time for the PDF document.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Pdf_PdfSecurity_UserPassword" data-uid="C1.Pdf.PdfSecurity.UserPassword">
          <a class="xref" href="C1.Pdf.PdfSecurity.UserPassword.html#C1_Pdf_PdfSecurity_UserPassword">UserPassword</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the password required to open the PDF document.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Pdf_PdfSecurity_Dispose" data-uid="C1.Pdf.PdfSecurity.Dispose">
          <a class="xref" href="C1.Pdf.PdfSecurity.Dispose.html#C1_Pdf_PdfSecurity_Dispose">Dispose()</a>
        </td>
        <td class="markdown level1 summary"><p>Clean up resources being used.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Pdf_PdfSecurity_GetStreamLength_System_Byte___" data-uid="C1.Pdf.PdfSecurity.GetStreamLength(System.Byte[])">
          <a class="xref" href="C1.Pdf.PdfSecurity.GetStreamLength.html#C1_Pdf_PdfSecurity_GetStreamLength_System_Byte___">GetStreamLength(byte[])</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the PDF file stream length for the data.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
