You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: keywrapper_pkcs11.go
    path of file: ./repos/sealer/vendor/github.com/containers/ocicrypt/keywrap/pkcs11
    
    the code of the file until where you have to start completion: /*
   Copyright The ocicrypt Authors.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

package pkcs11

import (
	"github.com/containers/ocicrypt/config"
	"github.com/containers/ocicrypt/crypto/pkcs11"
	"github.com/containers/ocicrypt/keywrap"
	"github.com/containers/ocicrypt/utils"

	"github.com/pkg/errors"
)

type pkcs11Ke
    
func (kw *pkcs11KeyWrapper) UnwrapKey(dc *config.DecryptConfig, jsonString []byte) ([]byte, error) {
	var pkcs11PrivKeys []*pkcs11.Pkcs11KeyFileObject

	privKeys := kw.GetPrivateKeys(dc.Parameters)
	if len(privKeys) == 0 {
		return nil, errors.New("No private keys found for PKCS11 decryption")
	}

	p11conf, err := p11confFromParameters(dc.Parameters)
	if err != nil {
		return nil, err
	}

	for _, privKey := range privKeys {
		key, err := utils.ParsePrivateKey(privKey, nil, "PKCS11")
		if err != nil {
			return nil, err
		}
		switch pkcs11PrivKey := key.(type) {
		case *pkcs11.Pkcs11KeyFileObject:
			if p11conf != nil {
				pkcs11PrivKey.Uri.SetModuleDirectories(p11conf.ModuleDirectories)
				pkcs11PrivKey.Uri.SetAllowedModulePaths(p11conf.AllowedModulePaths)
			}
			pkcs11PrivKeys = append(pkcs11PrivKeys, pkcs11PrivKey)
		default:
			continue
		}
	}

	plaintext, err := pkcs11.Decrypt(pkcs11PrivKeys, jsonString)
	if err == nil {
		return plaintext, nil
	}

	return nil, errors.Wrapf(err, "PKCS11: No suitable private key found for decryption")
}