# RSA Keys don't load

**URL:** <https://community.asterisk.org/t/rsa-keys-dont-load/108439>\
**Category:** Asterisk Support\
**Created:** [May 20, 2025, 1:07am UTC](https://community.asterisk.org/t/rsa-keys-dont-load/108439 "2025-05-20T01:07:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![edgreenberg](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/edgreenberg/32/6252_2.png) [@edgreenberg](https://community.asterisk.org/u/edgreenberg)\
**Post date:** [May 20, 2025, 1:07am UTC](https://community.asterisk.org/t/rsa-keys-dont-load/108439/1 "2025-05-20T01:07:34Z")

</div>

I have an Asterisk instance of 20.6.0~dfsg+~cs6.13.40431414-2build5 as installed from the Ubuntu repos on 24.04.

I’m trying to load an RSA key. I created it with `astgenkey -q -n phreaknetrsa` and wound up with keys in `/var/lib/asterisk/keys`. But wait, Ubuntu’s package, in asterisk.conf, contains:

```auto
astkeydir => /var/lib/asterisk

```

so I added /keys on the end and did a full reload.

I checked that res\_crypto was loaded, and did

```auto
module reload res_crypto
keys init
keys show

```

but no luck:

```auto
rthur*CLI> module reload res_crypto
arthur*CLI> keys init
Module 'res_crypto' reloaded successfully.
[May 19 18:43:24] -- Reloading module 'res_crypto.so' (Cryptographic Digital Signatures)
arthur*CLI> keys show
Key Name Type Status Sum                              
------------------ -------- ---------------- -------------------------------- 

0 known RSA keys.

```

My keys have the proper permissions:

```auto
root@arthur:/var/lib/asterisk# ls -l keys
total 8
-rw------- 1 asterisk asterisk 916 May 18 22:29 phreaknetrsa.key
-rw-r--r-- 1 root root 272 May 18 22:29 phreaknetrsa.pub
root@arthur:/var/lib/asterisk# 

```

My server runs as the asterisk user, as it was provided. I haven’t messed with it.

I should point out that I looked at the keys, and they look good:

```auto
-----BEGIN PRIVATE KEY-----
the key itself
-----END PRIVATE KEY-----

```

and

```auto
-----BEGIN PUBLIC KEY-----
the key itself
-----END PUBLIC KEY-----

```

I’m stumped. Any idea why my keys won’t load?

---

<div class="post-metadata">

**Author:** ![tootai](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@tootai](https://community.asterisk.org/u/tootai)\
**Post date:** [May 20, 2025, 8:37am UTC](https://community.asterisk.org/t/rsa-keys-dont-load/108439/2 "2025-05-20T08:37:21Z")

</div>

Put them in /usr/share/asterisk/keys

Le 20/05/2025 à 03:17, edgreenberg via Asterisk Community a écrit :

> [edgreenberg] edgreenberg [https://community.asterisk.org/u/edgreenberg](https://community.asterisk.org/u/edgreenberg)  
> May 20
> 
> I have an Asterisk instance of 20.6.0~dfsg+~cs6.13.40431414-2build5 as  
> installed from the Ubuntu repos on 24.04.
> 
> I’m trying to load an RSA key. I created it with |astgenkey -q -n  
> phreaknetrsa| and wound up with keys in |/var/lib/asterisk/keys|. But  
> wait, Ubuntu’s package, in asterisk.conf, contains:
> 
> |astkeydir =\> /var/lib/asterisk |
> 
> so I added /keys on the end and did a full reload.
> 
> I checked that res\_crypto was loaded, and did
> 
> |module reload res\_crypto keys init keys show |
> 
> but no luck:
> 
> |rthur_CLI\> module reload res\_crypto arthur_CLI\> keys init Module  
> ‘res\_crypto’ reloaded successfully. [May 19 18:43:24] – Reloading  
> module ‘res\_crypto.so’ (Cryptographic Digital Signatures) arthur\*CLI\>  
> keys show Key Name Type Status Sum ------------------ --------  
> ---------------- -------------------------------- 0 known RSA keys. |
> 
> My keys have the proper permissions:
> 
> |root@arthur:/var/lib/asterisk# ls -l keys total 8 -rw------- 1  
> asterisk asterisk 916 May 18 22:29 phreaknetrsa.key -rw-r–r-- 1 root  
> root 272 May 18 22:29 phreaknetrsa.pub root@arthur:/var/lib/asterisk# |
> 
> My server runs as the asterisk user, as it was provided. I haven’t  
> messed with it.
> 
> I should point out that I looked at the keys, and they look good:
> 
> |-----BEGIN PRIVATE KEY----- the key itself -----END PRIVATE KEY----- |
> 
> and
> 
> |-----BEGIN PUBLIC KEY----- the key itself -----END PUBLIC KEY----- |
> 
> I’m stumped. Any idea why my keys won’t load?
> 
> * * *
> 
> Visit Topic  
> [https://community.asterisk.org/t/rsa-keys-dont-load/108439/1](https://community.asterisk.org/t/rsa-keys-dont-load/108439/1) or  
> reply to this email to respond.
> 
> You are receiving this because you enabled mailing list mode.
> 
> To unsubscribe from these emails, click here  
> \<\>.

–  
Daniel

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [June 19, 2025, 8:37am UTC](https://community.asterisk.org/t/rsa-keys-dont-load/108439/3 "2025-06-19T08:37:43Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
