protected function afterRetrieveKeyPair(KeyPairInterface $keyPair)
    {
        if ($keyPair instanceof SecureKeyPairInterface) {
            $masterKeyPairProvider = $this->getMasterKeyPairProvider();
            $masterKeyName = $this->getMasterKeyName();
            if ($masterKeyPairProvider === null || !$masterKeyPairProvider->has($masterKeyName)) {
                throw new InaccessibleKeyPairException('Provider has an invalid master key provider specified for its secure keys');
            }
            $masterKey= $masterKeyPairProvider->get($masterKeyName);
            $keyPair->unlock($masterKey);
        }
        return $keyPair;
    }