atom-22
atom-22

Reputation: 199

How System.Security.Cryptography.OpenSsl calls OpenSSL functions?

can anyone explain how package System.Security.Cryptography.OpenSsl (github: dotnet/corefix) calls OpenSSL nanive functions? I can't find brige from .net C# to OpenSSL C++.

Upvotes: 2

Views: 4251

Answers (2)

Scott Wisniewski
Scott Wisniewski

Reputation: 25061

Take a look here:

https://github.com/dotnet/corefx/tree/master/src/Common/src/Interop/Unix/System.Security.Cryptography.Native

The code you link to references those interop classes, which pinvoke into this code here:

https://github.com/dotnet/corefx/tree/master/src/Native/Unix/System.Security.Cryptography.Native

Which calls into OpenSSL.

Upvotes: 1

kalimag
kalimag

Reputation: 1196

The types in the directory you linked to are all partial classes. The .csproj file in that directory includes a large number of files from elsewhere in the repo. These files contain most of the methods and [DllImport] platform invoke declarations.

The referenced CryptoNative (System.Security.Cryptography.Native.OpenSsl) library is a native shim found at corefx/src/Native/Unix/System.Security.Cryptography.Native, and forwards the calls to the actual OpenSSL implementation.

Upvotes: 1

Related Questions