DocumentBase.PasswordEncryptionKeyLength – vlastnost
Získá délku klíče algoritmus, který používá aplikaci Microsoft Office Word při šifrování dokumentů pomocí hesel.
Obor názvů: Microsoft.Office.Tools.Word
Sestavení: Microsoft.Office.Tools.Word.v4.0.Utilities (v Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
Syntaxe
'Deklarace
Public ReadOnly Property PasswordEncryptionKeyLength As Integer
public int PasswordEncryptionKeyLength { get; }
Hodnota vlastnosti
Typ: System.Int32
Délka klíče algoritmus Microsoft Office Word používá při šifrování dokumentů pomocí hesel.
Poznámky
Použití SetPasswordEncryptionOptions metoda k určení délky klíčů, který aplikace Word používá při šifrování dokumentů pomocí hesel.
Příklady
Následující příklad kódu nastaví heslo v případě, že heslo délku šifrovacího klíče je méně než 40 možnosti šifrování.Chcete-li použít tento příklad, spusťte jej z ThisDocument třídy v projektu na úrovni dokumentu.
Private Sub DocumentPasswordEncryptionKeyLength()
If Me.PasswordEncryptionKeyLength < 40 Then
Dim PasswordEncryptionProvider As String = _
"Microsoft RSA SChannel Cryptographic Provider"
Dim PasswordEncryptionAlgorithm As String = "RC4"
Dim PasswordEncryptionKeyLength As Integer = 56
Dim PasswordEncryptionFileProperties As Object = True
Me.SetPasswordEncryptionOptions(PasswordEncryptionProvider, _
PasswordEncryptionAlgorithm, PasswordEncryptionKeyLength, _
PasswordEncryptionFileProperties)
End If
End Sub
private void DocumentPasswordEncryptionKeyLength()
{
if (this.PasswordEncryptionKeyLength < 40)
{
string PasswordEncryptionProvider = "Microsoft RSA SChannel Cryptographic Provider";
string PasswordEncryptionAlgorithm = "RC4";
int PasswordEncryptionKeyLength = 56;
object PasswordEncryptionFileProperties = true;
this.SetPasswordEncryptionOptions(PasswordEncryptionProvider,
PasswordEncryptionAlgorithm, PasswordEncryptionKeyLength,
ref PasswordEncryptionFileProperties);
}
}
Zabezpečení rozhraní .NET Framework
- Plná důvěra přímému volajícímu. Částečně zabezpečený kód nemůže tento člen použít. Další informace naleznete v tématu Používání knihoven z částečně důvěryhodného kódu.