diff --git a/src/ecdsa/keys.py b/src/ecdsa/keys.py
index 4a673f6..105d0b2 100644
--- a/src/ecdsa/keys.py
+++ b/src/ecdsa/keys.py
@@ -1124,10 +1124,16 @@ class SigningKey(object):
                         "Non NULL parameters for a EdDSA key"
                     )
                 key_str_der, s = der.remove_octet_string(s)
-                if s:
-                    raise der.UnexpectedDER(
-                        "trailing junk inside the privateKey"
-                    )
+
+                # As RFC5958 describe, there are may be optional Attributes
+                # and Publickey. Don't raise error if something after
+                # Privatekey
+
+                # TODO parse attributes or validate publickey
+                # if s:
+                #     raise der.UnexpectedDER(
+                #         "trailing junk inside the privateKey"
+                #     )
                 key_str, s = der.remove_octet_string(key_str_der)
                 if s:
                     raise der.UnexpectedDER(

diff --git a/src/ecdsa/test_keys.py b/src/ecdsa/test_keys.py
index 564f312..0295881 100644
--- a/src/ecdsa/test_keys.py
+++ b/src/ecdsa/test_keys.py
@@ -927,3 +927,13 @@ def test_VerifyingKey_inequality_with_different_secret_points():
     sk2 = SigningKey.from_secret_exponent(3, BRAINPOOLP160r1)
 
     assert sk1.verifying_key != sk2.verifying_key
+
+
+def test_SigningKey_from_pem_pkcs8v2_EdDSA():
+    pem = """-----BEGIN PRIVATE KEY-----
+    MFMCAQEwBQYDK2VwBCIEICc2F2ag1n1QP0jY+g9qWx5sDkx0s/HdNi3cSRHw+zsI
+    oSMDIQA+HQ2xCif8a/LMWR2m5HaCm5I2pKe/cc8OiRANMHxjKQ==
+    -----END PRIVATE KEY-----"""
+
+    sk = SigningKey.from_pem(pem)
+    assert sk.curve == Ed25519

SigningKey.from_pem may not support pkcs#8 v2
I'm using ecdsa 0.18.0b1, and trying to use it to load private key from pem file.

When I use `SigningKey.from_pem(pem.encode()`, password=None) to load pem file, the pem data is in PKCS#8 v2 format, RFC 5958:
```
-----BEGIN PRIVATE KEY-----
MFMCAQEwBQYDK2VwBCIEIGQqNAZlORmn1k4QrYz1FvO4fOQowS3GXQMqRKDzmx9P
oSMDIQCrO5iGM5hnLWrHavywoXekAoXPpYRuB0Dr6DjZF6FZkg==
-----END PRIVATE KEY-----
```
I got an error:
```
File "/usr/local/lib/python3.9/site-packages/ecdsa/keys.py", line 1020, in from_pem
    return cls.from_der(
  File "/usr/local/lib/python3.9/site-packages/ecdsa/keys.py", line 1119, in from_der
    raise der.UnexpectedDER(
ecdsa.der.UnexpectedDER: trailing junk inside the privateKey
```

Actually, I'm trying to build an application initially written in rust, and convert it to python version. So I need to parse pem file generated by rust version. I used [Ed25519KeyPair::generate_pkcs8](https://docs.rs/ring/0.16.20/ring/signature/struct.Ed25519KeyPair.html#method.generate_pkcs8) to generate keys in PKC8 v2 format


src/ecdsa/test_keys.py::test_SigningKey_from_pem_pkcs8v2_EdDSA
src/ecdsa/test_keys.py::TestVerifyingKeyFromString::test_array_array_of_bytes src/ecdsa/test_keys.py::TestVerifyingKeyFromString::test_array_array_of_bytes_memoryview src/ecdsa/test_keys.py::TestVerifyingKeyFromString::test_array_array_of_ints src/ecdsa/test_keys.py::TestVerifyingKeyFromString::test_array_array_of_ints_memoryview src/ecdsa/test_keys.py::TestVerifyingKeyFromString::test_bytearray src/ecdsa/test_keys.py::TestVerifyingKeyFromString::test_bytearray_compressed src/ecdsa/test_keys.py::TestVerifyingKeyFromString::test_bytearray_uncompressed src/ecdsa/test_keys.py::TestVerifyingKeyFromString::test_bytes src/ecdsa/test_keys.py::TestVerifyingKeyFromString::test_bytes_compressed src/ecdsa/test_keys.py::TestVerifyingKeyFromString::test_bytes_memoryview src/ecdsa/test_keys.py::TestVerifyingKeyFromString::test_bytes_uncompressed src/ecdsa/test_keys.py::TestVerifyingKeyFromString::test_bytesarray_memoryview src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_SigningKey_inequality_on_same_curve src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_VerifyingKey_inequality_on_same_curve src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_array_array_of_bytes src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_array_array_of_bytes_memoryview src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_bytearray src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_bytes src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_bytes_memoryview src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_bytesarray_memoryview src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_custom_hashfunc src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_ed25519_VerifyingKey_repr__ src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_ed25519_export_import src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_ed25519_sig_verify src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_ed448_export_import src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_ed448_from_pem src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_ed448_sig_verify src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_ed448_to_pem src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_edwards_from_public_key_recovery src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_edwards_from_public_key_recovery_with_digest src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_edwards_from_public_point src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_edwards_precompute_no_side_effect src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_equality_on_verifying_keys src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_export_ed255_to_pem src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_from_pem_with_custom_hashfunc src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_from_public_point_old src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_inequality_on_verifying_keys src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_inequality_on_verifying_keys_not_implemented src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_inequality_on_wrong_types src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_load_ed25519_from_pem src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_load_key_with_disabled_format src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_load_key_with_explicit_parameters src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_load_key_with_explicit_with_explicit_disabled src/ecdsa/test_keys.py::TestVerifyingKeyFromDer::test_parse_malfomed_eddsa_der_pubkey src/ecdsa/test_keys.py::TestSigningKey::test_compare_verifying_key_with_precompute src/ecdsa/test_keys.py::TestSigningKey::test_decoding_explicit_curve_parameters src/ecdsa/test_keys.py::TestSigningKey::test_decoding_explicit_curve_parameters_with_explicit_disabled src/ecdsa/test_keys.py::TestSigningKey::test_ed25519_from_pem src/ecdsa/test_keys.py::TestSigningKey::test_ed25519_to_and_from_pem src/ecdsa/test_keys.py::TestSigningKey::test_ed25519_to_pem src/ecdsa/test_keys.py::TestSigningKey::test_ed448_encode_decode src/ecdsa/test_keys.py::TestSigningKey::test_ed448_from_pem src/ecdsa/test_keys.py::TestSigningKey::test_ed448_to_pem src/ecdsa/test_keys.py::TestSigningKey::test_equality_on_signing_keys src/ecdsa/test_keys.py::TestSigningKey::test_inequality_on_signing_keys src/ecdsa/test_keys.py::TestSigningKey::test_inequality_on_signing_keys_not_implemented src/ecdsa/test_keys.py::TestSigningKey::test_verify_with_lazy_precompute src/ecdsa/test_keys.py::TestSigningKey::test_verify_with_precompute src/ecdsa/test_keys.py::TestTrivialCurve::test_deterministic_sign src/ecdsa/test_keys.py::TestTrivialCurve::test_deterministic_sign_random_message src/ecdsa/test_keys.py::TestTrivialCurve::test_deterministic_sign_that_rises_R_zero_error src/ecdsa/test_keys.py::TestTrivialCurve::test_deterministic_sign_that_rises_S_zero_error src/ecdsa/test_keys.py::TestTrivialCurve::test_generator_sanity src/ecdsa/test_keys.py::TestTrivialCurve::test_public_key_sanity src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify-bytes-raw] src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify_digest-bytes-raw] src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify-bytes-der] src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify_digest-bytes-der] src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify-bytes-strings] src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify_digest-bytes-strings] src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify-bytes src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify_digest-bytes src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify-bytearray-raw] src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify_digest-bytearray-raw] src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify-bytearray-der] src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify_digest-bytearray-der] src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify-bytearray-strings] src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify_digest-bytearray-strings] src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify-bytearray src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify_digest-bytearray src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify-array.array src/ecdsa/test_keys.py::test_VerifyingKey_verify[verify_digest-array.array src/ecdsa/test_keys.py::test_SigningKey_from_string[bytes] src/ecdsa/test_keys.py::test_SigningKey_from_string[bytes src/ecdsa/test_keys.py::test_SigningKey_from_string[bytearray] src/ecdsa/test_keys.py::test_SigningKey_from_string[bytearray src/ecdsa/test_keys.py::test_SigningKey_from_string[array.array src/ecdsa/test_keys.py::test_SigningKey_from_der[bytes] src/ecdsa/test_keys.py::test_SigningKey_from_der[bytes src/ecdsa/test_keys.py::test_SigningKey_from_der[bytearray] src/ecdsa/test_keys.py::test_SigningKey_from_der[bytearray src/ecdsa/test_keys.py::test_SigningKey_from_der[array.array src/ecdsa/test_keys.py::test_SigningKey_sign_deterministic[bytes] src/ecdsa/test_keys.py::test_SigningKey_sign_deterministic[bytes src/ecdsa/test_keys.py::test_SigningKey_sign_deterministic[bytearray] src/ecdsa/test_keys.py::test_SigningKey_sign_deterministic[bytearray src/ecdsa/test_keys.py::test_SigningKey_sign_deterministic[array.array src/ecdsa/test_keys.py::test_SigningKey_sign_digest_deterministic[bytes] src/ecdsa/test_keys.py::test_SigningKey_sign_digest_deterministic[bytes src/ecdsa/test_keys.py::test_SigningKey_sign_digest_deterministic[bytearray] src/ecdsa/test_keys.py::test_SigningKey_sign_digest_deterministic[bytearray src/ecdsa/test_keys.py::test_SigningKey_sign_digest_deterministic[array.array src/ecdsa/test_keys.py::test_SigningKey_sign[bytes] src/ecdsa/test_keys.py::test_SigningKey_sign[bytes src/ecdsa/test_keys.py::test_SigningKey_sign[bytearray] src/ecdsa/test_keys.py::test_SigningKey_sign[bytearray src/ecdsa/test_keys.py::test_SigningKey_sign[array.array src/ecdsa/test_keys.py::test_SigningKey_sign_digest[bytes] src/ecdsa/test_keys.py::test_SigningKey_sign_digest[bytes src/ecdsa/test_keys.py::test_SigningKey_sign_digest[bytearray] src/ecdsa/test_keys.py::test_SigningKey_sign_digest[bytearray src/ecdsa/test_keys.py::test_SigningKey_sign_digest[array.array src/ecdsa/test_keys.py::test_SigningKey_with_unlikely_value src/ecdsa/test_keys.py::test_SigningKey_with_custom_curve_old_point src/ecdsa/test_keys.py::test_VerifyingKey_inequality_with_different_curves src/ecdsa/test_keys.py::test_VerifyingKey_inequality_with_different_secret_points