EncryptedPackageEnvelope::CreateFromPackage Method (Stream, Stream, PublishLicense, CryptoProvider)

Creates and returns an EncryptedPackageEnvelope (on the specified stream) that uses the specified unencrypted package as its content.

Namespace:  System.IO.Packaging
Assembly:  WindowsBase (in WindowsBase.dll)

public:
static EncryptedPackageEnvelope^ CreateFromPackage(
	Stream^ envelopeStream, 
	Stream^ packageStream, 
	PublishLicense^ publishLicense, 
	CryptoProvider^ cryptoProvider
)

Parameters

envelopeStream
Type: System.IO::Stream

The stream on which to create the file.

packageStream
Type: System.IO::Stream

The stream representing the existing unencrypted package.

publishLicense
Type: System.Security.RightsManagement::PublishLicense

The publish license that is embedded in the compound file.

cryptoProvider
Type: System.Security.RightsManagement::CryptoProvider

An object that determines what operations the current user is allowed to perform on the encrypted content.

ExceptionCondition
ArgumentNullException

envelopeStream or packageStream is nullptr.

NotSupportedException

envelopeStream does not provide read/write access.

The current user has read/write access to the new file.

The following example shows how to use the CreateFromPackage method to instantiate an EncryptedPackageEnvelope.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft