public string GetAsnFormattedData() { CertificateAuthority.Models.Asn1Functions.Asn1Functions asnFnc = new CertificateAuthority.Models.Asn1Functions.Asn1Functions(); Oid oidObj = new Oid("2.5.29.31"); byte[] rawExtensionData = System.IO.File.ReadAllBytes(@"F:\DevGit\certs\csharptest\encodingusinglib\crltext-base64decode-bytes1.txt"); return(asnFnc.FormatNative(oidObj, rawExtensionData, true)); }
//public string AsnFormattedDataFromByteArray(string Oid, byte[] RawExtensionData) public string AsnFormattedDataFromFile([FromBody] AsnEncodedFileLocation F) { Oid oidObj = new Oid(F.Oid); CertificateAuthority.Models.Asn1Functions.Asn1Functions asnFnc = new CertificateAuthority.Models.Asn1Functions.Asn1Functions(); byte[] rawExtensionData = System.IO.File.ReadAllBytes($@"{F.FilePath}"); return(asnFnc.FormatNative(oidObj, rawExtensionData, true)); }
//public string AsnFormattedDataFromByteArray(string Oid, byte[] RawExtensionData) public string AsnFormattedDataFromBase64String([FromBody] AsnEncodedDataClass A) { Oid oidObj = new Oid(A.Oid); CertificateAuthority.Models.Asn1Functions.Asn1Functions asnFnc = new CertificateAuthority.Models.Asn1Functions.Asn1Functions(); byte[] rawExtensionData = System.Convert.FromBase64String(A.Base64ExtensionData); //byte[] rawExtensionData = System.IO.File.ReadAllBytes(@"F:\DevGit\certs\csharptest\encodingusinglib\crltext-base64decode-bytes1.txt"); return(asnFnc.FormatNative(oidObj, rawExtensionData, true)); }