Skip to content

Commit

Permalink
Use rsaEncryption OID for RSA keys
Browse files Browse the repository at this point in the history
  • Loading branch information
jschanck committed Aug 30, 2024
1 parent b04ce2f commit 5292153
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/crypto/der.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ pub const OID_SECP256R1_BYTES: &[u8] = &[
0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07,
];
pub const OID_ED25519_BYTES: &[u8] = &[/* RFC 8410 (id-ed25519) */ 0x2b, 0x65, 0x70];
pub const OID_RS256_BYTES: &[u8] = &[
/* RFC 4055 (sha256WithRSAEncryption) */
0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b,
pub const OID_RSA_ENCRYPTION_BYTES: &[u8] = &[
/* RFC 4055 (rsaEncryption) */
0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01,
];

pub type Result<T> = std::result::Result<T, CryptoError>;
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ impl COSERSAKey {
// algorithm: AlgorithmIdentifier
&der::sequence(&[
// algorithm
&der::object_id(der::OID_RS256_BYTES)?,
&der::object_id(der::OID_RSA_ENCRYPTION_BYTES)?,
// parameters
&der::null()?,
])?,
Expand Down

0 comments on commit 5292153

Please sign in to comment.