public PSSqlClientEncryptionKeyGetPropertiesResource(ClientEncryptionKeyGetPropertiesResource clientEncryptionKeyGetPropertiesResource)
        {
            if (clientEncryptionKeyGetPropertiesResource == null)
            {
                return;
            }

            Id = clientEncryptionKeyGetPropertiesResource.Id;
            EncryptionAlgorithm      = clientEncryptionKeyGetPropertiesResource.EncryptionAlgorithm;
            KeyWrapMetaData          = new PSKeyWrapMetadata(clientEncryptionKeyGetPropertiesResource.KeyWrapMetadata);
            WrappedDataEncryptionKey = clientEncryptionKeyGetPropertiesResource.WrappedDataEncryptionKey;
            _rid  = clientEncryptionKeyGetPropertiesResource._rid;
            _ts   = clientEncryptionKeyGetPropertiesResource._ts;
            _etag = clientEncryptionKeyGetPropertiesResource._etag;
        }
Exemplo n.º 2
0
        public static KeyWrapMetadata ToSDKModel(PSKeyWrapMetadata pSKeyWrapMetadata)
        {
            if (pSKeyWrapMetadata == null)
            {
                return(null);
            }

            if (string.IsNullOrEmpty(pSKeyWrapMetadata.Name))
            {
                throw new ArgumentNullException("Name cannot be null or empty");
            }

            if (string.IsNullOrEmpty(pSKeyWrapMetadata.Type))
            {
                throw new ArgumentNullException("Type cannot be null or empty");
            }

            if (string.IsNullOrEmpty(pSKeyWrapMetadata.Value))
            {
                throw new ArgumentNullException("Value cannot be null or empty");
            }

            if (string.IsNullOrEmpty(pSKeyWrapMetadata.Algorithm))
            {
                throw new ArgumentNullException("Algorithm cannot be null or empty");
            }

            KeyWrapMetadata keyWrapMetadata = new KeyWrapMetadata
            {
                Name      = pSKeyWrapMetadata.Name,
                Type      = pSKeyWrapMetadata.Type,
                Value     = pSKeyWrapMetadata.Value,
                Algorithm = pSKeyWrapMetadata.Algorithm
            };

            return(keyWrapMetadata);
        }