예제 #1
0
        public AdESResult CAdESSign(byte[] dataToSign, SignatureContext signatureContext)
        {
            AdESResult result;

#if NET5_0
            using (dynamic wr = CLRLoader.CLRLibrary
                                .CreateCLRInstance(BaseConstants.AdESCLRWrapperClassName))
#else
            using (dynamic wr = CLRLoader.CLRFrameworkLibrary
                                .CreateCLRInstance(BaseConstants.AdESCLRFrameworWrapperClassName))
#endif
            {
                wr.IsDebug = false;

                var coreSignatureContext = signatureContext.ConvertSignatureContext();
                var coreResult           = wr.CAdESSign(dataToSign, coreSignatureContext);

                result = DataConversion.ConvertAdESResult(coreResult);
            }
            return(result);
        }