Who to get private key from Azure key

Ravi V (Trianz) 20 Reputation points
2024-11-13T11:36:10.9133333+00:00

Using application API how get Private Key which is import in Azure Key Object or how get private of Generate key.

We are try to get private key using below class or code whether it possible to get or not ?

KeyVaultKey key = keyClient.getKey("mca-cxp-decryption-private-key"); KeyPair keyPair = key.getKey().toRsa(); PrivateKey privateKey = keyPair.getPrivate();

Here, privateKey object is null.

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,406 questions
{count} votes

Accepted answer
  1. Navya 17,085 Reputation points Microsoft External Staff
    2024-11-14T18:37:22.7833333+00:00

    Hi @Ravi V (Trianz)

    Thank you for posting this in Microsoft Q&A.

    I understand that you are trying to retrieve a private key from Azure Key Vault, but you are getting a null value.

    Unfortunately, it is not possible to retrieve a private key from Azure Key Vault. You can only get the public key from Azure Key Vault.

    User's image

    For your reference: https://learn.microsoft.com/en-us/azure/key-vault/keys/quick-create-portal

    Hope this helps. Do let us know if you any further queries.

    Thanks,

    Navya.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.