System::Net::Security::SslStream 类

SslStream class

使用 SSL 协议对服务器进行身份验证并可选地对客户端进行身份验证的流。

class SslStream : public System::Net::Security::AuthenticatedStream

方法

方法描述
virtual AuthenticateAsClient(String)对连接的客户端侧进行身份验证。
virtual AuthenticateAsClient(String, System::SharedPtr<System::Security::Cryptography::X509Certificates::X509CertificateCollection>, System::Security::Authentication::SslProtocols, bool)对连接的客户端侧进行身份验证。
BeginRead(System::ArrayPtr<uint8_t>, int32_t, int32_t, AsyncCallback, System::SharedPtr<Object>) override发起异步读取操作。
BeginWrite(System::ArrayPtr<uint8_t>, int32_t, int32_t, AsyncCallback, System::SharedPtr<Object>) override发起异步写入操作。
Close() override关闭流。
Dispose(bool) override释放当前对象使用的所有资源并关闭流。
EndRead(System::SharedPtr<IAsyncResult>) override等待指定的异步读取操作完成。
EndWrite(System::SharedPtr<IAsyncResult>) override结束异步写入操作。等待指定的异步写入操作完成。
Flush() override清除此流的缓冲区并将所有缓冲的数据写入底层存储。
get_CanRead() const override确定流是否可读取。
get_CanSeek() const override确定流是否支持定位。
get_CanTimeout() const override获取一个值,用于确定当前流是否可以超时。
get_CanWrite() const override确定流是否可写。
virtual get_CheckCertRevocationStatus()返回一个值,指示在证书验证过程中是否检查证书吊销列表。
virtual get_CipherAlgorithm()返回加密算法。
virtual get_CipherStrength()返回所使用加密算法的强度。
virtual get_HashAlgorithm()返回哈希算法。
virtual get_HashStrength()返回所使用哈希算法的强度。
get_IsAuthenticated() const override返回一个值,指示身份验证是否成功通过。
get_IsEncrypted() const override返回一个值,指示通过此流发送的数据是否已加密。
get_IsMutuallyAuthenticated() const override返回一个值,指示服务器和客户端是否已通过身份验证。
get_IsServer() const override返回一个值,指示连接的本地端是否为服务器。
get_IsSigned() const override返回一个值,指示使用此流发送的数据是否已签名。
virtual get_KeyExchangeStrength()返回所使用密钥交换算法的强度。
get_Length() const override返回流的字节长度。
virtual get_LocalCertificate()返回用于验证本地端点的证书。
get_Position() const override返回流的当前位置。
get_ReadTimeout() const override获取一个以毫秒为单位的值,用于确定流在超时前尝试读取的持续时间。
virtual get_RemoteCertificate()返回用于验证远程端点的证书。
virtual get_SslProtocol()返回 SSL 协议。
get_WriteTimeout() const override获取一个以毫秒为单位的值,用于确定流在超时前尝试写入的持续时间。
Read(const ArrayPtr<uint8_t>&, int32_t, int32_t) override从流中读取指定数量的字节并将其写入指定的字节数组。
Read(const System::Details::ArrayView<uint8_t>&, int32_t, int32_t) override从流中读取指定数量的字节并将其写入指定的字节数组。
Seek(int64_t, IO::SeekOrigin) override设置当前对象所表示的流的位置。
set_Position(int64_t) override设置流的位置。
set_ReadTimeout(int32_t) override设置一个值,用于确定当前流是否可以超时。
set_WriteTimeout(int32_t) override设置一个以毫秒为单位的值,用于确定流在超时前尝试读取的持续时间。
SetLength(int64_t) override设置当前对象所表示的流的长度。
SslStream(System::SharedPtr<IO::Stream>)构造一个新实例。
SslStream(System::SharedPtr<IO::Stream>, bool)构造一个新实例。
SslStream(System::SharedPtr<IO::Stream>, bool, RemoteCertificateValidationCallback)构造一个新实例。
SslStream(System::SharedPtr<IO::Stream>, bool, RemoteCertificateValidationCallback, LocalCertificateSelectionCallback)构造一个新实例。
SslStream(System::SharedPtr<IO::Stream>, bool, RemoteCertificateValidationCallback, LocalCertificateSelectionCallback, EncryptionPolicy)构造一个新实例。
Write(const ArrayPtr<uint8_t>&)将指定的字节数组写入流。
Write(const ArrayPtr<uint8_t>&, int32_t, int32_t) override将指定字节数组中的指定子范围字节写入流。
Write(const System::Details::ArrayView<uint8_t>&)将指定的字节数组写入流。
Write(const System::Details::ArrayView<uint8_t>&, int32_t, int32_t) override将指定字节数组中的指定子范围字节写入流。

字段

字段描述
static Null一个没有底层存储的流。

Typedefs

类型定义描述
AsyncResultTypeRTTI 信息。
StreamImplementationPtr实现的指针类型。

另见