public IntPtr DeserializePublicKey(byte[] buffer) { IntPtr publicKey; this.errorId = LibpreWrapper.DeserializePublicKey(this.parameters, buffer, buffer.Length, out publicKey, this.scheme); AssertSuccess(); return(publicKey); }
//private void DeleteParams(IntPtr par) //{ // this.errorId = LibpreWrapper.DestroyParams(par); // AssertSuccess(); //} public InMemoryKeyPair GenerateKeyPair() { IntPtr publicKey; IntPtr privateKey; this.errorId = LibpreWrapper.GenerateKeys(this.parameters, out publicKey, out privateKey, this.scheme); AssertSuccess(); return(new InMemoryKeyPair(publicKey, privateKey)); }
public Libpre(Scheme scheme, byte[] parameters) { this.scheme = scheme; // Initialize unmanaged library by having it generate parameters first. // This is required to avoid a weird error where it otherwise would crash // the entire process if initialized with parameters the first time. this.errorId = LibpreWrapper.GenerateParams(out this.parameters, this.scheme); AssertSuccess(); // if we actually received some premade parameters, then use those) if (parameters != null) { LibpreWrapper.DestroyParams(this.parameters); this.parameters = DeserializeParams(parameters); } }
public void DeleteDelegationKey(IntPtr delegationKey) { this.errorId = LibpreWrapper.DestroyDelegationKey(delegationKey, this.scheme); AssertSuccess(); }
public void DeletePrivateKey(IntPtr privateKey) { this.errorId = LibpreWrapper.DestroyKeys(this.parameters, IntPtr.Zero, privateKey, this.scheme); AssertSuccess(); }
public void DeleteKeyPair(InMemoryKeyPair keys) { this.errorId = LibpreWrapper.DestroyKeys(this.parameters, keys.PublicKey, keys.PrivateKey, this.scheme); AssertSuccess(); }