Skip to content

Commit

Permalink
update secure-env to 0.5
Browse files Browse the repository at this point in the history
Signed-off-by: Berend Sliedrecht <[email protected]>
  • Loading branch information
berendsliedrecht committed Jul 25, 2024
1 parent 7813768 commit 06e957a
Show file tree
Hide file tree
Showing 7 changed files with 2,514 additions and 3,940 deletions.
41 changes: 20 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion askar-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ p384 = { version = "0.13", default-features = false, features = [
"ecdh",
], optional = true }
rand = { version = "0.8", default-features = false }
secure-env = { package = "animo-secure-env", version = "0.4", optional = true }
secure-env = { package = "animo-secure-env", version = "0.5", optional = true }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde-json-core = { version = "0.5", default-features = false }
sha2 = { version = "0.10", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion askar-crypto/src/alg/p256_hardware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl P256HardwareKeyPair {
/// used.
pub fn generate(id: &str) -> Result<Self, Error> {
Ok(Self {
inner: SecureEnvironment::generate_keypair(id)?,
inner: SecureEnvironment::generate_keypair(id, true)?,
key_id: SecretBytes::from_slice(id.as_bytes()),
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"plugins": [
"expo-local-authentication",
{
"faceIDPermission": "Allow $(PRODUCT_NAME) to use Face ID."
}
],
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dependencies": {
"@hyperledger/aries-askar-react-native": "workspace:*",
"expo": "~51.0.2",
"expo-local-authentication": "~14.0.1",
"expo-status-bar": "~1.12.1",
"react": "18.2.0",
"react-native": "0.74.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ariesAskar } from '@hyperledger/aries-askar-react-native'
import { KeyAlgs, KeyBackend, LocalKeyHandle, ariesAskar } from '@hyperledger/aries-askar-react-native'
import { authenticateAsync } from 'expo-local-authentication'
import { useEffect } from 'react'
import { StyleSheet, Text, View } from 'react-native'

const styles = StyleSheet.create({
Expand All @@ -11,6 +13,14 @@ const styles = StyleSheet.create({
})

export const App = () => (
useEffect(() => {
void (async () => {
const key = ariesAskar.keyGenerate({algorithm: KeyAlgs.EcSecp256r1,keyBackend: KeyBackend.SecureElement,ephemeral: false})
const result = await authenticateAsync()
ariesAskar.keySignMessage({message: new Uint8Array(10).fill(42),localKeyHandle: new LocalKeyHandle(key.handle)})
})()
},[])

<View style={styles.container}>
<Text>{ariesAskar.version()}</Text>
</View>
Expand Down
Loading

0 comments on commit 06e957a

Please sign in to comment.