ED25519 private key length invalid

My ED25519 key was generated through the asymmetricKeyGenerator tool. The private key is base64 encoded, the length is 64, and after decoding it is 48 bytes. However, when I use the private key to sign through js, it prompts that the key length is illegal. ED25519 Shouldn’t the private key be 32 bytes, what should I do next?

AsymmeticKeyGenerator tool produces PKCS#8 encoding of the key following RFC 8410. For private keys, the OneAsymmetricKey structure (aka PrivateKeyInfo) includes version and algorithm information in addition to the 32 bytes of the key material.

It’s best to load the private key from the encoded form using an appropriate API. See SubtleCrypto.importKey().