Skip to content

Update RSAKey.php #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Component/Core/Util/RSAKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function toPEM(): string
)
);

return PEM::create(PEM::TYPE_RSA_PRIVATE_KEY, $this->sequence->toDER())
return PEM::create(PEM::TYPE_PRIVATE_KEY, $this->sequence->toDER())
->string();
}
$this->sequence = Sequence::create(
Expand All @@ -169,7 +169,7 @@ public function toPEM(): string
)
);

return PEM::create(PEM::TYPE_RSA_PUBLIC_KEY, $this->sequence->toDER())
return PEM::create(PEM::TYPE_PUBLIC_KEY, $this->sequence->toDER())
->string();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Component/Console/KeyConversionCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function iCanConvertARsaKeyIntoPKCS1(): void
$command = new PemConverterCommand();
$command->run($input, $output);
$content = $output->fetch();
static::assertStringContainsString('-----BEGIN RSA PRIVATE KEY-----', $content);
static::assertStringContainsString('-----BEGIN PRIVATE KEY-----', $content);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Component/KeyManagement/JWKTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public function theRSAKeyIsCorrectlyConvertedIntoPEM(): void

// Then
static::assertSame(
'-----BEGIN RSA PUBLIC KEY-----
'-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAz62tHQzm4fDHipqlcrNh
C1gUdn0N38pmlcQbVlLvtZf1aRm1OO43cB9YQyWr1MsTrYH4nyWZDMPIGY/BsIfY
w1lp9fo2D1tpG2vtCaKRETVimu+N9DySQ9vYs6n8lG0vXy/spK7sGrOLFooijDSt
Expand All @@ -271,7 +271,7 @@ public function theRSAKeyIsCorrectlyConvertedIntoPEM(): void
XCARX1IObFJNoinxYJ5SNX9bCSRtgefuBKE7BSNukAkHyBPf+++kEi9GbYXzlJr+
yCMAIsA0UoiEx264hkAF9zF+N1yRhS/QmrhzU5hpj1IE8WRCqyIZV8f/IbSGXBue
7MmgknLVRWHuGqehkTSfiNECAwEAAQ==
-----END RSA PUBLIC KEY-----',
-----END PUBLIC KEY-----',
$pem
);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Component/KeyManagement/Keys/RSA/private.key
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-----BEGIN RSA PRIVATE KEY-----
-----BEGIN PRIVATE KEY-----
MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAN91kQxBuaze3WjI
CNjeR/HD8E3kDzp89+Lhtn3tMish4yQxhNl6BEkabuS3pUj3WDP6+AFjBVqA1j3f
u8Wqu7hRJDPHOs2kCII+LhIqvqQTLx/nvNOUhW2DimKn0HuHnlwJODq0MHFJEq5R
Expand All @@ -13,4 +13,4 @@ RVdVjA/gFqJp1Q+VWdS1tvYRIqmadkECQCVdqQuwgedEHmcewtNod42crjmwvWBx
BKMTl6/WT4zwVb41eUujVWo0LHRLuCoK//GDqmloIh6L3MU8MqnIGb0CQFWcpD4/
roCkMblk0hPoQPpyapJexc438x7XuEGFEhyxxauqC5R4YFKCf+KBS2gZgr4GSwBU
Qww+qZ3eRYM7faM=
-----END RSA PRIVATE KEY-----
-----END PRIVATE KEY-----
4 changes: 2 additions & 2 deletions tests/Component/KeyManagement/Keys/RSA/public.key
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
-----BEGIN RSA PUBLIC KEY-----
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtpS1ZmfVKVP5KofIhMBP
0tSWc4qlh6fm2lrZSkuKxUjEaWjzZSzs72gEIGxraWusMdoRuV54xsWRyf5KeZT0
S+I5Prle3Idi3gICiO4NwvMk6JwSBcJWwmSLFEKyUSnB2CtfiGc0/5rQCpcEt/Dn
5iM+BNn7fqpoLIbks8rXKUIj8+qMVqkTXsEKeKinE23t1ykMldsNaaOH+hvGti5J
t2DMnH1JjoXdDXfxvSP/0gjUYb0ektudYFXoA6wekmQyJeImvgx4Myz1I4iHtkY/
Cp7J4Mn1ejZ6HNmyvoTE/4OuY1uCeYv4UyXFc1s1uUyYtj4z57qsHGsS4dQ3A2MJ
swIDAQAB
-----END RSA PUBLIC KEY-----
-----END PUBLIC KEY-----