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

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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)

static member CreateFromPackage : 
        envelopeStream:Stream *
        packageStream:Stream *
        publishLicense:PublishLicense *
        cryptoProvider:CryptoProvider -> EncryptedPackageEnvelope

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.

Exception Condition
ArgumentNullException

envelopeStream or packageStream is null.

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
Available since 3.0
Return to top
Show: