다음을 통해 공유


SymmetricAlgorithm.Key 속성

대칭 알고리즘에 대한 비밀 키를 가져오거나 설정합니다.

네임스페이스: System.Security.Cryptography
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public Overridable Property Key As Byte()
‘사용 방법
Dim instance As SymmetricAlgorithm
Dim value As Byte()

value = instance.Key

instance.Key = value
public virtual byte[] Key { get; set; }
public:
virtual property array<unsigned char>^ Key {
    array<unsigned char>^ get ();
    void set (array<unsigned char>^ value);
}
/** @property */
public byte[] get_Key ()

/** @property */
public void set_Key (byte[] value)
public function get Key () : byte[]

public function set Key (value : byte[])

속성 값

대칭 알고리즘에 사용할 비밀 키입니다.

예외

예외 형식 조건

ArgumentNullException

키를 Null 참조(Visual Basic의 경우 Nothing)로 설정하려고 한 경우

설명

비밀 키는 암호화와 해독 모두에 사용됩니다. 대칭 알고리즘을 제대로 사용하려면 송신자와 수신자에게만 비밀 키를 알려야 합니다. 올바른 키 크기는 특정 대칭 알고리즘 구현에 의해 지정되어 LegalKeySizes 속성에 나열됩니다.

이 속성을 사용할 때 속성이 Null 참조(Visual Basic의 경우 Nothing)이면 GenerateKey 메서드가 호출되어 임의의 값이 새로 만들어집니다.

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0에서 지원

참고 항목

참조

SymmetricAlgorithm 클래스
SymmetricAlgorithm 멤버
System.Security.Cryptography 네임스페이스

기타 리소스

암호화 서비스