i want "xml signature x509 sha256 " code give signature (byte[]) ı want signature xmldocument x509 please me
xmldocument docc = new xmldocument(); docc.load("c:\\users\\bera\\desktop\\sertifika\\aa.xml"); x509store storemycurrentuser = new x509store(storename.my, storelocation.currentuser); storemycurrentuser.open(openflags.maxallowed); x509certificate2 certrca = new x509certificate2("c:\\users\\bera\\desktop\\rca.p12", "0123456789"); if (!storemycurrentuser.certificates.contains(certrca)) storemycurrentuser.add(certrca); rsacryptoserviceprovider _provider = null; //doc.outerxml byte[] data = encoding.default.getbytes(doc.outerxml); if (certrca.hasprivatekey) { _provider = (rsacryptoserviceprovider)certrca.privatekey; byte[] sigedbytes = _provider.signdata(data, "sha256"); string a= system.text.encoding.ascii.getstring(sigedbytes); console.writeline(a);
Comments
Post a Comment