Skip to content

Commit 82565cb

Browse files
authored
Merge pull request #105 from jonasnick/pk_as_mut_ptr
Add as_mut_ptr to PublicKey
2 parents bf9b972 + 91c43e7 commit 82565cb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/key.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,18 @@ impl<'de> ::serde::Deserialize<'de> for SecretKey {
213213
}
214214

215215
impl PublicKey {
216-
/// Obtains a raw pointer suitable for use with FFI functions
216+
/// Obtains a raw const pointer suitable for use with FFI functions
217217
#[inline]
218218
pub fn as_ptr(&self) -> *const ffi::PublicKey {
219219
&self.0 as *const _
220220
}
221221

222+
/// Obtains a raw mutable pointer suitable for use with FFI functions
223+
#[inline]
224+
pub fn as_mut_ptr(&mut self) -> *mut ffi::PublicKey {
225+
&mut self.0 as *mut _
226+
}
227+
222228
/// Creates a new public key from a secret key.
223229
#[inline]
224230
pub fn from_secret_key<C: Signing>(secp: &Secp256k1<C>,

0 commit comments

Comments
 (0)