func (c *CredentialsInfo) DecryptEncPart(k types.EncryptionKey) error {
	if k.KeyType != int32(c.EType) {
		return fmt.Errorf("key provided is not the correct type. Type needed: %d, type provided: %d", c.EType, k.KeyType)
	}
	pt, err := crypto.DecryptMessage(c.PACCredentialDataEncrypted, k, keyusage.KERB_NON_KERB_SALT)
	if err != nil {
		return err
	}
	err = c.PACCredentialData.Unmarshal(pt)
	if err != nil {
		return err
	}
	return nil
}
DecryptEncPart decrypts the encrypted part of the CredentialsInfo.
package pac
import (
	"bytes"
	"errors"
	"fmt"
	"github.com/jcmturner/gokrb5/v8/crypto"
	"github.com/jcmturner/gokrb5/v8/iana/keyusage"
	"github.com/jcmturner/gokrb5/v8/types"
	"github.com/jcmturner/rpc/v2/mstypes"
	"github.com/jcmturner/rpc/v2/ndr"
)
type CredentialsInfo struct {
	Version                    uint32  
	EType                      uint32
	PACCredentialDataEncrypted []byte  
	PACCredentialData          CredentialData
}
func (c *CredentialsInfo) Unmarshal(b []byte, k types.EncryptionKey) (err error) {
	r := mstypes.NewReader(bytes.NewReader(b))
	c.Version, err = r.Uint32()
	if err != nil {
		return
	}
	if c.Version != 0 {
		err = errors.New("credentials info version is not zero")
		return
	}
	c.EType, err = r.Uint32()
	if err != nil {
		return
	}
	c.PACCredentialDataEncrypted, err = r.ReadBytes(len(b) - 8)
	if err != nil {
		err = fmt.Errorf("error reading PAC Credetials Data: %v", err)
		return
	}
	err = c.DecryptEncPart(k)
	if err != nil {
		err = fmt.Errorf("error decrypting PAC Credentials Data: %v", err)
		return
	}
	return
}