Skip to content

Conversation

@ionut-arm
Copy link
Member

Signed-off-by: Ionut Mihalcea ionut.mihalcea@arm.com

@ionut-arm ionut-arm requested a review from hug-dev February 11, 2021 16:30
@ionut-arm ionut-arm self-assigned this Feb 11, 2021
@hug-dev
Copy link
Member

hug-dev commented Feb 11, 2021

Sorry to add this on your back, but since you are importing this in parsec-tool, what do you think about putting this method on BasicClient 🤡 :

/// Get the key attributes.
pub fn key_attributes(basic_client: &BasicClient, key_name: &str) -> Result<Attributes> {
    // First let's find the key to find its algorithm
    let keys = basic_client.list_keys()?;
    let key_info = keys
        .into_iter()
        .find(|key_info| key_info.name == key_name)
        .ok_or(Error::ParsecClientError(
            parsec_client::error::Error::Service(ResponseStatus::PsaErrorDoesNotExist),
        ))?;
    Ok(key_info.attributes)
}

This commit updates the interface revision used and adds a method on
`BasicClient` for retrieving key attributes.

Signed-off-by: Ionut Mihalcea <ionut.mihalcea@arm.com>
Copy link
Member

@hug-dev hug-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ionut-arm ionut-arm merged commit a915d9a into parallaxsecond:master Feb 11, 2021
@ionut-arm ionut-arm deleted the psa-bump branch February 11, 2021 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants