📄 pdfencryption.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using AnotherPDFLib.PdfGraphics;
namespace AnotherPDFLib
{
public partial class PdfEncryption : PdfDictionary
{
/// <summary>
/// The name of the preferred security handler for this document.
/// </summary>
public string Filter
{
get
{
PdfName filter = this["Filter"] as PdfName;
if (filter != null)
{
return filter.Value;
}
return String.Empty;
}
set
{
this["Filter"] = new PdfName(value);
}
}
/// <summary>
/// A name that completely specifies the format and interpretation of the contents of the encryption dictionary.
/// </summary>
public string SubFilter
{
get
{
PdfName subfilter = this["SubFilter"] as PdfName;
if (subfilter != null)
{
return subfilter.Value;
}
return String.Empty;
}
set
{
this["SubFilter"] = new PdfName(value);
}
}
/// <summary>
/// A code specifying the algorithm to be used in encrypting and decrypting the document.
/// </summary>
public int Version
{
get
{
PdfInteger version = this["V"] as PdfInteger;
if (version != null)
{
return version.Value;
}
return 0;
}
set
{
this["V"] = new PdfInteger(value);
}
}
/// <summary>
/// The length of the encryption key, in bits. The value must be a multiple of 8, in the range 40 to 128.
/// </summary>
public int KeyLength
{
get
{
PdfInteger keylength = this["Length"] as PdfInteger;
if (keylength != null)
{
return keylength.Value;
}
return 40;
}
set
{
this["Length"] = new PdfInteger(value);
}
}
/// <summary>
/// A dictionary whose keys are crypt filter names and whose values are the corresponding crypt filter dictionaries.
/// </summary>
public PdfDictionary CryptFilters
{
get
{
return this["CF"] as PdfDictionary;
}
set
{
this["CF"] = value;
}
}
/// <summary>
/// The name of the crypt filter that is used by default when decrypting streams. The name must be a key in the CF dictionary or a standard crypt filter name.
/// </summary>
public string StreamFilter
{
get
{
PdfName streamfilter = this["StmF"] as PdfName;
if (streamfilter != null)
{
return streamfilter.Value;
}
return String.Empty;
}
set
{
this["StmF"] = new PdfName(value);
}
}
/// <summary>
/// The name of the crypt filter that is used when decrypting all strings in the document. The name must be a key in the CF dictionary or a standard crypt filter name.
/// </summary>
public string StringFilter
{
get
{
PdfName stringfilter = this["StrF"] as PdfName;
if (stringfilter != null)
{
return stringfilter.Value;
}
return String.Empty;
}
set
{
this["StrF"] = new PdfName(value);
}
}
/// <summary>
/// The name of the crypt filter that should be used by default when encrypting embedded file streams; it must correspond to a key in the CF dictionary or a standard crypt filter name.
/// </summary>
public string EmbeddedFileFilter
{
get
{
PdfName embeddedfilefilter = this["EFF"] as PdfName;
if (embeddedfilefilter != null)
{
return embeddedfilefilter.Value;
}
return String.Empty;
}
set
{
this["EFF"] = new PdfName(value);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -