code: func MarshalEd25519PublicKey(pk crypto.PublicKey) ([]byte, error) {
  	pub, ok := pk.(ed25519.PublicKey)
  	if !ok {
  		return nil, errEd25519WrongKeyType
  	}
  
  	spki := subjectPublicKeyInfo{
  		Algorithm: pkix.AlgorithmIdentifier{
  			Algorithm: ed25519OID,
  		},
  		PublicKey: asn1.BitString{
  			BitLength: len(pub) * 8,
  			Bytes:     pub,
  		},
  	}
  
  	return asn1.Marshal(spki)
  }
docs: // MarshalEd25519PublicKey creates a DER-encoded SubjectPublicKeyInfo for an
  // ed25519 public key, as defined in
  // https://tools.ietf.org/html/draft-ietf-curdle-pkix-04. This is analagous to
  // MarshalPKIXPublicKey in crypto/x509, which doesn't currently support Ed25519.