CryptoStream 클래스

정의

데이터 스트림을 암호화 변환에 연결하는 스트림을 정의합니다.

public ref class CryptoStream : System::IO::Stream
public class CryptoStream : System.IO.Stream
[System.Runtime.InteropServices.ComVisible(true)]
public class CryptoStream : System.IO.Stream
type CryptoStream = class
    inherit Stream
    interface IDisposable
[<System.Runtime.InteropServices.ComVisible(true)>]
type CryptoStream = class
    inherit Stream
    interface IDisposable
Public Class CryptoStream
Inherits Stream
상속
CryptoStream
상속
특성
구현

예제

다음 예에서는 를 사용하여 문자열을 CryptoStream 암호화하는 방법을 보여 줍니다. 이 메서드는 지정된 및 초기화 벡터(IV)와 함께 클래스를 Key 사용합니다Aes.

using System;
using System.IO;
using System.Security.Cryptography;

class AesExample
{
    public static void Main()
    {
        try
        {
            string original = "Here is some data to encrypt!";

            // Create a new instance of the Aes class.
            // This generates a new key and initialization vector (IV).
            using (Aes myAes = Aes.Create())
            {
                // Encrypt the string to an array of bytes.
                byte[] encrypted = EncryptStringToBytes(original, myAes.Key, myAes.IV);

                // Decrypt the bytes to a string.
                string roundtrip = DecryptStringFromBytes(encrypted, myAes.Key, myAes.IV);

                // Display the original data and the decrypted data.
                Console.WriteLine("Original:   {0}", original);
                Console.WriteLine("Round trip: {0}", roundtrip);
            }
        }
        catch (Exception e)
        {
            Console.WriteLine("Error: {0}", e.Message);
        }
    }

    static byte[] EncryptStringToBytes(string plainText, byte[] Key, byte[] IV)
    {
        // Check arguments.
        if (plainText == null || plainText.Length <= 0)
            throw new ArgumentNullException(nameof(plainText));
        if (Key == null || Key.Length <= 0)
            throw new ArgumentNullException(nameof(Key));
        if (IV == null || IV.Length <= 0)
            throw new ArgumentNullException(nameof(IV));
        byte[] encrypted;

        // Create a Aes object with the specified key and IV.
        using (Aes aesAlg = Aes.Create())
        {
            aesAlg.Key = Key;
            aesAlg.IV = IV;

            // Create an encryptor to perform the stream transform.
            ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV);

            // Create the streams used for encryption.
            using (MemoryStream msEncrypt = new())
            {
                using (CryptoStream csEncrypt = new(msEncrypt, encryptor, CryptoStreamMode.Write))
                {
                    using (StreamWriter swEncrypt = new(csEncrypt))
                    {
                        // Write all data to the stream.
                        swEncrypt.Write(plainText);
                    }
                    encrypted = msEncrypt.ToArray();
                }
            }
        }

        // Return the encrypted bytes from the memory stream.
        return encrypted;
    }

    static string DecryptStringFromBytes(byte[] cipherText, byte[] Key, byte[] IV)
    {
        // Check arguments.
        if (cipherText == null || cipherText.Length <= 0)
            throw new ArgumentNullException(nameof(cipherText));
        if (Key == null || Key.Length <= 0)
            throw new ArgumentNullException(nameof(Key));
        if (IV == null || IV.Length <= 0)
            throw new ArgumentNullException(nameof(IV));

        // Declare the string used to hold the decrypted text.
        string plaintext = null;

        // Create a Aes object with the specified key and IV.
        using (Aes aesAlg = Aes.Create())
        {
            aesAlg.Key = Key;
            aesAlg.IV = IV;

            // Create a decryptor to perform the stream transform.
            ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);

            // Create the streams used for decryption.
            using (MemoryStream msDecrypt = new(cipherText))
            {
                using (CryptoStream csDecrypt = new(msDecrypt, decryptor, CryptoStreamMode.Read))
                {
                    using (StreamReader srDecrypt = new(csDecrypt))
                    {

                        // Read the decrypted bytes from the decrypting stream
                        // and place them in a string.
                        plaintext = srDecrypt.ReadToEnd();
                    }
                }
            }
        }

        return plaintext;
    }
}
Imports System.IO
Imports System.Security.Cryptography

Class AesExample

    Public Shared Sub Main()
        Try
            Dim original As String = "Here is some data to encrypt!"

            ' Create a new instance of the Aes class.
            ' This generates a new key and initialization vector (IV).
            Using myAes = Aes.Create()

                ' Encrypt the string to an array of bytes.
                Dim encrypted As Byte() = EncryptStringToBytes(original, myAes.Key, myAes.IV)

                ' Decrypt the bytes to a string.
                Dim roundtrip As String = DecryptStringFromBytes(encrypted, myAes.Key, myAes.IV)

                'Display the original data and the decrypted data.
                Console.WriteLine("Original:   {0}", original)
                Console.WriteLine("Round Trip: {0}", roundtrip)
            End Using
        Catch e As Exception
            Console.WriteLine("Error: {0}", e.Message)
        End Try
    End Sub

    Shared Function EncryptStringToBytes(ByVal plainText As String, ByVal Key() As Byte, ByVal IV() As Byte) As Byte()
        ' Check arguments.
        If plainText Is Nothing OrElse plainText.Length <= 0 Then
            Throw New ArgumentNullException(NameOf(plainText))
        End If
        If Key Is Nothing OrElse Key.Length <= 0 Then
            Throw New ArgumentNullException(NameOf(Key))
        End If
        If IV Is Nothing OrElse IV.Length <= 0 Then
            Throw New ArgumentNullException(NameOf(IV))
        End If
        Dim encrypted() As Byte

        ' Create an Aes object with the specified key and IV.
        Using aesAlg = Aes.Create()

            aesAlg.Key = Key
            aesAlg.IV = IV

            ' Create an encryptor to perform the stream transform.
            Dim encryptor As ICryptoTransform = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV)
            ' Create the streams used for encryption.
            Using msEncrypt As New MemoryStream()
                Using csEncrypt As New CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write)
                    Using swEncrypt As New StreamWriter(csEncrypt)

                        ' Write all data to the stream.
                        swEncrypt.Write(plainText)
                    End Using
                    encrypted = msEncrypt.ToArray()
                End Using
            End Using
        End Using

        ' Return the encrypted bytes from the memory stream.
        Return encrypted

    End Function 'EncryptStringToBytes

    Shared Function DecryptStringFromBytes(
        ByVal cipherText() As Byte,
        ByVal Key() As Byte,
        ByVal IV() As Byte) As String
        ' Check arguments.
        If cipherText Is Nothing OrElse cipherText.Length <= 0 Then
            Throw New ArgumentNullException(NameOf(cipherText))
        End If
        If Key Is Nothing OrElse Key.Length <= 0 Then
            Throw New ArgumentNullException(NameOf(Key))
        End If
        If IV Is Nothing OrElse IV.Length <= 0 Then
            Throw New ArgumentNullException(NameOf(IV))
        End If

        ' Declare the string used to hold the decrypted text.
        Dim plaintext As String = Nothing

        ' Create an Aes object with the specified key and IV.
        Using aesAlg = Aes.Create()
            aesAlg.Key = Key
            aesAlg.IV = IV

            ' Create a decryptor to perform the stream transform.
            Dim decryptor As ICryptoTransform = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV)

            ' Create the streams used for decryption.
            Using msDecrypt As New MemoryStream(cipherText)
                Using csDecrypt As New CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)
                    Using srDecrypt As New StreamReader(csDecrypt)
                        ' Read the decrypted bytes from the decrypting stream
                        ' and place them in a string.
                        plaintext = srDecrypt.ReadToEnd()
                    End Using
                End Using
            End Using
        End Using

        Return plaintext

    End Function 'DecryptStringFromBytes 
End Class

설명

공용 언어 런타임은 암호화에 스트림 지향 디자인을 사용합니다. 이 디자인의 핵심은 입니다 CryptoStream. 구현하는 모든 암호화 개체는 를 구현 CryptoStreamStream하는 모든 개체와 함께 연결될 수 있으므로 한 개체의 스트리밍된 출력을 다른 개체의 입력으로 공급할 수 있습니다. 중간 결과(첫 번째 개체의 출력)는 별도로 저장할 필요가 없습니다.

중요

.NET 6 이상 버전 Stream.Read 에서 또는 Stream.ReadAsync 가 버퍼 길이 N로 호출되면 스트림에서 1 바이트 이상을 읽거나 래핑하는 기본 스트림이 에 대한 호출 Read에서 0을 반환하여 더 이상 데이터를 사용할 수 없음을 나타내는 작업이 완료됩니다. .NET 6 Stream.ReadStream.ReadAsync 이전에는 스트림에서 모든 N 바이트를 읽거나 기본 스트림이 에 대한 호출 Read에서 0을 반환할 때까지 를 반환하지 않았습니다. 코드에서 메서드가 Read 모든 N 바이트를 읽을 때까지 반환되지 않는다고 가정하면 모든 콘텐츠를 읽지 못할 수 있습니다. 자세한 내용은 스트림의 부분 및 0 바이트 읽기를 참조하세요.

메서드를 호출하여 개체 사용을 완료한 후에는 항상 명시적으로 개체를 ClearCryptoStream 아야 합니다. 이렇게 하면 기본 스트림이 플러시되고 나머지 모든 데이터 블록이 개체에서 CryptoStream 처리됩니다. 그러나 메서드를 호출하기 전에 예외가 Close 발생하면 개체가 CryptoStream 닫혀 있지 않을 수 있습니다. 메서드가 Close 항상 호출되도록 하려면 메서드에 대한 호출을 Clear 문의 블록 try/catch 내에 finally 배치합니다.

이 형식이 구현 하는 IDisposable 인터페이스입니다. 형식 사용을 완료한 경우 메서드를 호출 Clear 하여 직접 또는 간접적으로 삭제해야 합니다. 이 메서드는 해당 구현을 호출합니다 IDisposable . 직접 형식의 dispose 호출 해당 Clear 의 메서드를 try/catch 블록입니다. 삭제 하지 직접, 언어 구문 같은 사용 using (C#에서) 또는 Using (Visual Basic에서는).

생성자

CryptoStream(Stream, ICryptoTransform, CryptoStreamMode)

대상 데이터 스트림, 사용할 변환 및 스트림 모드를 사용하여 CryptoStream 클래스의 새 인스턴스를 초기화합니다.

CryptoStream(Stream, ICryptoTransform, CryptoStreamMode, Boolean)

CryptoStream 클래스의 새 인스턴스를 초기화합니다.

속성

CanRead

현재 CryptoStream을 읽을 수 있는지 여부를 나타내는 값을 가져옵니다.

CanSeek

현재 CryptoStream 내에서 검색할 수 있는지 여부를 나타내는 값을 가져옵니다.

CanTimeout

현재 스트림이 시간 초과될 수 있는지를 결정하는 값을 가져옵니다.

(다음에서 상속됨 Stream)
CanWrite

현재 CryptoStream에 쓸 수 있는지 여부를 나타내는 값을 가져옵니다.

HasFlushedFinalBlock

마지막 버퍼 블록을 내부 스트림에 썼는지 여부를 나타내는 값을 가져옵니다.

Length

스트림의 길이(바이트)를 가져옵니다.

Position

현재 스트림 내의 위치를 가져오거나 설정합니다.

ReadTimeout

스트림 읽기 시도가 만료되기 전까지 기다릴 시간을 결정하는 값(밀리초)을 가져오거나 설정합니다.

(다음에서 상속됨 Stream)
WriteTimeout

스트림 쓰기 시도가 만료되기 전까지 기다릴 시간을 결정하는 값(밀리초)을 가져오거나 설정합니다.

(다음에서 상속됨 Stream)

메서드

BeginRead(Byte[], Int32, Int32, AsyncCallback, Object)

비동기 읽기 작업을 시작합니다. 대신 ReadAsync를 사용하세요.

BeginRead(Byte[], Int32, Int32, AsyncCallback, Object)

비동기 읽기 작업을 시작합니다. 대신 ReadAsync(Byte[], Int32, Int32)를 사용하세요.

(다음에서 상속됨 Stream)
BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object)

비동기 쓰기 작업을 시작합니다. 대신 WriteAsync를 사용하세요.

BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object)

비동기 쓰기 작업을 시작합니다. 대신 WriteAsync(Byte[], Int32, Int32)를 사용하세요.

(다음에서 상속됨 Stream)
Clear()

CryptoStream에서 사용하는 모든 리소스를 해제합니다.

Close()

현재 스트림을 닫고 현재 스트림과 관련된 소켓과 파일 핸들 등의 리소스를 모두 해제합니다.

Close()

현재 스트림을 닫고 현재 스트림과 관련된 소켓과 파일 핸들 등의 리소스를 모두 해제합니다. 이 메서드를 호출하는 대신 스트림이 올바르게 삭제되었는지 확인합니다.

(다음에서 상속됨 Stream)
CopyTo(Stream)

현재 스트림에서 바이트를 읽어서 다른 스트림에 해당 바이트를 씁니다. 두 스트림 위치는 복사된 바이트 수만큼 고급입니다.

(다음에서 상속됨 Stream)
CopyTo(Stream, Int32)

기본 스트림에서 바이트를 읽고, 관련 암호화 변환을 적용하고, 결과를 대상 스트림에 씁니다.

CopyTo(Stream, Int32)

현재 스트림에서 바이트를 읽어서 지정된 버퍼 크기로 다른 스트림에 씁니다. 두 스트림 위치는 복사된 바이트 수만큼 고급입니다.

(다음에서 상속됨 Stream)
CopyToAsync(Stream)

현재 스트림에서 모든 바이트를 비동기적으로 읽어 다른 스트림에 씁니다. 두 스트림 위치는 복사된 바이트 수만큼 고급입니다.

(다음에서 상속됨 Stream)
CopyToAsync(Stream, CancellationToken)

현재 스트림에서 바이트를 비동기적으로 읽어 지정된 취소 토큰을 사용하여 다른 스트림에 씁니다. 두 스트림 위치는 복사된 바이트 수만큼 고급입니다.

(다음에서 상속됨 Stream)
CopyToAsync(Stream, Int32)

현재 스트림에서 바이트를 비동기적으로 읽어 지정된 버퍼 크기로 다른 스트림에 씁니다. 두 스트림 위치는 복사된 바이트 수만큼 고급입니다.

(다음에서 상속됨 Stream)
CopyToAsync(Stream, Int32, CancellationToken)

기본 스트림에서 바이트를 비동기적으로 읽고, 관련 암호화 변환을 적용하고, 결과를 대상 스트림에 씁니다.

CopyToAsync(Stream, Int32, CancellationToken)

현재 스트림에서 바이트를 비동기적으로 읽어 지정된 버퍼 크기 및 취소 토큰을 사용하여 다른 스트림에 씁니다. 두 스트림 위치는 복사된 바이트 수만큼 고급입니다.

(다음에서 상속됨 Stream)
CreateObjRef(Type)

원격 개체와 통신하는 데 사용되는 프록시 생성에 필요한 모든 관련 정보가 들어 있는 개체를 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
CreateWaitHandle()
사용되지 않음.
사용되지 않음.
사용되지 않음.

WaitHandle 개체를 할당합니다.

(다음에서 상속됨 Stream)
Dispose()

Stream에서 사용하는 모든 리소스를 해제합니다.

(다음에서 상속됨 Stream)
Dispose(Boolean)

CryptoStream에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 해제할 수 있습니다.

DisposeAsync()

CryptoStream에서 사용하는 관리되지 않는 리소스를 비동기적으로 해제합니다.

DisposeAsync()

Stream에서 사용하는 관리되지 않는 리소스를 비동기적으로 해제합니다.

(다음에서 상속됨 Stream)
EndRead(IAsyncResult)

보류 중인 비동기 읽기가 완료되기를 기다립니다. 대신 ReadAsync를 사용하세요.

EndRead(IAsyncResult)

보류 중인 비동기 읽기가 완료되기를 기다립니다. 대신 ReadAsync(Byte[], Int32, Int32)를 사용하세요.

(다음에서 상속됨 Stream)
EndWrite(IAsyncResult)

비동기 쓰기 작업을 끝냅니다. 대신 WriteAsync를 사용하세요.

EndWrite(IAsyncResult)

비동기 쓰기 작업을 끝냅니다. 대신 WriteAsync(Byte[], Int32, Int32)를 사용하세요.

(다음에서 상속됨 Stream)
Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
Finalize()

가비지 컬렉션이 회수하기 전에 개체가 리소스를 해제하고 다른 정리 작업을 수행할 수 있게 합니다.

Flush()

현재 스트림의 모든 버퍼를 지우면 버퍼링된 모든 데이터가 내부 디바이스에 쓰여집니다.

FlushAsync()

이 스트림에 대한 모든 버퍼를 비동기적으로 지우고 버퍼링된 모든 데이터가 내부 디바이스에 비동기적으로 쓰여지도록 합니다.

(다음에서 상속됨 Stream)
FlushAsync(CancellationToken)

현재 스트림에 대해 모든 버퍼를 비동기적으로 지우고 버퍼링된 데이터가 내부 디바이스에 쓰여지도록 하고 취소 요청을 모니터링합니다.

FlushAsync(CancellationToken)

이 스트림에 대해 모든 버퍼를 비동기적으로 지우고 버퍼링된 데이터가 내부 디바이스에 쓰여지도록 하고 취소 요청을 모니터링합니다.

(다음에서 상속됨 Stream)
FlushFinalBlock()

내부 데이터 소스 또는 리포지토리에 버퍼의 현재 상태를 업데이트한 다음 해당 버퍼를 지웁니다.

FlushFinalBlockAsync(CancellationToken)

기본 데이터 소스나 리포지토리를 현재 버퍼 상태로 비동기적으로 업데이트한 다음 버퍼를 지웁니다.

GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetLifetimeService()
사용되지 않음.

이 인스턴스의 수명 정책을 제어하는 현재의 수명 서비스 개체를 검색합니다.

(다음에서 상속됨 MarshalByRefObject)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
InitializeLifetimeService()
사용되지 않음.

이 인스턴스의 수명 정책을 제어하는 수명 서비스 개체를 가져옵니다.

(다음에서 상속됨 MarshalByRefObject)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
MemberwiseClone(Boolean)

현재 MarshalByRefObject 개체의 단순 복사본을 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
ObjectInvariant()
사용되지 않음.

Contract에 대한 지원을 제공합니다.

(다음에서 상속됨 Stream)
Read(Byte[], Int32, Int32)

현재 스트림에서 바이트 시퀀스를 읽고 읽은 바이트 수만큼 스트림에서 위치를 앞으로 이동합니다.

Read(Span<Byte>)

파생 클래스에서 재정의되면 현재 스트림에서 바이트의 시퀀스를 읽고, 읽은 바이트 수만큼 스트림 내에서 앞으로 이동합니다.

(다음에서 상속됨 Stream)
ReadAsync(Byte[], Int32, Int32)

현재 스트림에서 바이트 시퀀스를 읽고 읽은 바이트 수만큼 스트림에서 위치를 비동기적으로 앞으로 이동합니다.

(다음에서 상속됨 Stream)
ReadAsync(Byte[], Int32, Int32, CancellationToken)

현재 스트림에서 바이트의 시퀀스를 비동기적으로 읽고 읽은 바이트 수만큼 스트림 내에서 앞으로 이동하며 취소 요청을 모니터링합니다.

ReadAsync(Byte[], Int32, Int32, CancellationToken)

현재 스트림에서 바이트의 시퀀스를 비동기적으로 읽고 읽은 바이트 수만큼 스트림 내에서 앞으로 이동하며 취소 요청을 모니터링합니다.

(다음에서 상속됨 Stream)
ReadAsync(Memory<Byte>, CancellationToken)

현재 스트림에서 바이트의 시퀀스를 비동기적으로 읽고 읽은 바이트 수만큼 스트림 내에서 앞으로 이동하며 취소 요청을 모니터링합니다.

ReadAsync(Memory<Byte>, CancellationToken)

현재 스트림에서 바이트의 시퀀스를 비동기적으로 읽고 읽은 바이트 수만큼 스트림 내에서 앞으로 이동하며 취소 요청을 모니터링합니다.

(다음에서 상속됨 Stream)
ReadAtLeast(Span<Byte>, Int32, Boolean)

현재 스트림에서 최소 바이트 수를 읽고 읽은 바이트 수만큼 스트림 내의 위치를 진행합니다.

(다음에서 상속됨 Stream)
ReadAtLeastAsync(Memory<Byte>, Int32, Boolean, CancellationToken)

현재 스트림에서 최소 바이트 수를 비동기적으로 읽고, 스트림 내의 위치를 읽은 바이트 수만큼 발전시키고, 취소 요청을 모니터링합니다.

(다음에서 상속됨 Stream)
ReadByte()

스트림에서 바이트를 읽고 스트림 내 위치를 한 바이트씩 앞으로 이동하거나 스트림 끝일 경우 -1을 반환합니다.

ReadByte()

스트림에서 바이트를 읽고 스트림 내 위치를 한 바이트씩 앞으로 이동하거나 스트림 끝일 경우 -1을 반환합니다.

(다음에서 상속됨 Stream)
ReadExactly(Byte[], Int32, Int32)

count 현재 스트림에서 바이트 수를 읽고 스트림 내의 위치를 이동합니다.

(다음에서 상속됨 Stream)
ReadExactly(Span<Byte>)

현재 스트림에서 바이트를 읽고 가 채워질 때까지 buffer 스트림 내의 위치를 이동합니다.

(다음에서 상속됨 Stream)
ReadExactlyAsync(Byte[], Int32, Int32, CancellationToken)

현재 스트림에서 바이트 수를 비동기적으로 읽고 count , 스트림 내의 위치를 확장하고, 취소 요청을 모니터링합니다.

(다음에서 상속됨 Stream)
ReadExactlyAsync(Memory<Byte>, CancellationToken)

현재 스트림에서 바이트를 비동기적으로 읽고, 가 채워질 때까지 buffer 스트림 내의 위치를 발전시키고, 취소 요청을 모니터링합니다.

(다음에서 상속됨 Stream)
Seek(Int64, SeekOrigin)

현재 스트림 내에서 위치를 설정합니다.

SetLength(Int64)

현재 스트림의 길이를 설정합니다.

ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)
Write(Byte[], Int32, Int32)

현재 CryptoStream에 바이트의 시퀀스를 쓰고 스트림 내의 현재 위치를 쓰여진 바이트 수만큼 앞으로 이동합니다.

Write(ReadOnlySpan<Byte>)

파생 클래스를 재정의될 때 현재 스트림에 바이트의 시퀀스를 쓰고 쓰여진 바이트 수만큼 이 스트림 내에서 앞으로 이동합니다.

(다음에서 상속됨 Stream)
WriteAsync(Byte[], Int32, Int32)

현재 스트림에 바이트 시퀀스를 비동기적으로 쓰고 쓴 바이트 수만큼 이 스트림에서 현재 위치를 앞으로 이동합니다.

(다음에서 상속됨 Stream)
WriteAsync(Byte[], Int32, Int32, CancellationToken)

바이트의 시퀀스를 현재 스트림에 비동기적으로 쓰고 쓰여진 바이트 수만큼 스트림 내의 현재 위치를 앞으로 이동한 후 취소 요청을 모니터링합니다.

WriteAsync(Byte[], Int32, Int32, CancellationToken)

바이트의 시퀀스를 현재 스트림에 비동기적으로 쓰고 쓰여진 바이트 수만큼 이 스트림 내의 현재 위치를 앞으로 이동한 후 취소 요청을 모니터링합니다.

(다음에서 상속됨 Stream)
WriteAsync(ReadOnlyMemory<Byte>, CancellationToken)

바이트의 시퀀스를 현재 스트림에 비동기적으로 쓰고 쓰여진 바이트 수만큼 이 스트림 내의 현재 위치를 앞으로 이동한 후 취소 요청을 모니터링합니다.

WriteAsync(ReadOnlyMemory<Byte>, CancellationToken)

바이트의 시퀀스를 현재 스트림에 비동기적으로 쓰고 쓰여진 바이트 수만큼 이 스트림 내의 현재 위치를 앞으로 이동한 후 취소 요청을 모니터링합니다.

(다음에서 상속됨 Stream)
WriteByte(Byte)

스트림의 현재 위치에 바이트를 쓰고 스트림 내 위치를 1바이트씩 앞으로 이동합니다.

WriteByte(Byte)

스트림의 현재 위치에 바이트를 쓰고 스트림 내 위치를 1바이트씩 앞으로 이동합니다.

(다음에서 상속됨 Stream)

명시적 인터페이스 구현

IDisposable.Dispose()

이 API는 제품 인프라를 지원하며 코드에서 직접 사용되지 않습니다.

CryptoStream 클래스의 현재 인스턴스에서 사용하는 리소스를 해제합니다.

확장 메서드

ConfigureAwait(IAsyncDisposable, Boolean)

비동기 일회용에서 반환되는 작업을 대기하는 방법을 구성합니다.

적용 대상

추가 정보