C# 클래스 Org.BouncyCastle.Bcpg.OpenPgp.PgpEncryptedDataGenerator

Generator for encrypted objects.
상속: IStreamGenerator
파일 보기 프로젝트 열기: nonorganic/dssnet 1 사용 예제들

공개 메소드들

메소드 설명
AddMethod ( PgpPublicKey key ) : void

Add a public key encrypted session key to the encrypted object.

AddMethod ( char passPhrase ) : void

Add a PBE encryption method to the encrypted object using the default algorithm (S2K_SHA1).

AddMethod ( char passPhrase, HashAlgorithmTag s2kDigest ) : void

Add a PBE encryption method to the encrypted object.

Close ( ) : void

Close off the encrypted object - this is equivalent to calling Close() on the stream returned by the Open() method.

Note: This does not close the underlying output stream, only the stream on top of it created by the Open() method.

Open ( Stream outStr, byte buffer ) : Stream

Return an output stream which will encrypt the data as it is written to it. The stream will be written out in chunks according to the size of the passed in buffer.

The stream created can be closed off by either calling Close() on the stream or Close() on the generator. Closing the returned stream does not close off the Stream parameter outStr.

Note: if the buffer is not a power of 2 in length only the largest power of 2 bytes worth of the buffer will be used.

Open ( Stream outStr, long length ) : Stream

Return an output stream which will encrypt the data as it is written to it.

The stream created can be closed off by either calling Close() on the stream or Close() on the generator. Closing the returned stream does not close off the Stream parameter outStr.

PgpEncryptedDataGenerator ( SymmetricKeyAlgorithmTag encAlgorithm ) : System
PgpEncryptedDataGenerator ( SymmetricKeyAlgorithmTag encAlgorithm, SecureRandom rand ) : System

Existing SecureRandom constructor.

PgpEncryptedDataGenerator ( SymmetricKeyAlgorithmTag encAlgorithm, SecureRandom rand, bool oldFormat ) : System

Base constructor.

PgpEncryptedDataGenerator ( SymmetricKeyAlgorithmTag encAlgorithm, bool withIntegrityPacket ) : System
PgpEncryptedDataGenerator ( SymmetricKeyAlgorithmTag encAlgorithm, bool withIntegrityPacket, SecureRandom rand ) : System

Creates a cipher stream which will have an integrity packet associated with it.

비공개 메소드들

메소드 설명
AddCheckSum ( byte sessionInfo ) : void
CreateSessionInfo ( SymmetricKeyAlgorithmTag algorithm, KeyParameter key ) : byte[]
Open ( Stream outStr, long length, byte buffer ) : Stream

If buffer is non null stream assumed to be partial, otherwise the length will be used to output a fixed length packet.

The stream created can be closed off by either calling Close() on the stream or Close() on the generator. Closing the returned stream does not close off the Stream parameter outStr.

메소드 상세

AddMethod() 공개 메소드

Add a public key encrypted session key to the encrypted object.
public AddMethod ( PgpPublicKey key ) : void
key PgpPublicKey
리턴 void

AddMethod() 공개 메소드

Add a PBE encryption method to the encrypted object using the default algorithm (S2K_SHA1).
public AddMethod ( char passPhrase ) : void
passPhrase char
리턴 void

AddMethod() 공개 메소드

Add a PBE encryption method to the encrypted object.
public AddMethod ( char passPhrase, HashAlgorithmTag s2kDigest ) : void
passPhrase char
s2kDigest HashAlgorithmTag
리턴 void

Close() 공개 메소드

Close off the encrypted object - this is equivalent to calling Close() on the stream returned by the Open() method.

Note: This does not close the underlying output stream, only the stream on top of it created by the Open() method.

public Close ( ) : void
리턴 void

Open() 공개 메소드

Return an output stream which will encrypt the data as it is written to it. The stream will be written out in chunks according to the size of the passed in buffer.

The stream created can be closed off by either calling Close() on the stream or Close() on the generator. Closing the returned stream does not close off the Stream parameter outStr.

Note: if the buffer is not a power of 2 in length only the largest power of 2 bytes worth of the buffer will be used.

public Open ( Stream outStr, byte buffer ) : Stream
outStr Stream
buffer byte
리턴 Stream

Open() 공개 메소드

Return an output stream which will encrypt the data as it is written to it.

The stream created can be closed off by either calling Close() on the stream or Close() on the generator. Closing the returned stream does not close off the Stream parameter outStr.

public Open ( Stream outStr, long length ) : Stream
outStr Stream
length long
리턴 Stream

PgpEncryptedDataGenerator() 공개 메소드

public PgpEncryptedDataGenerator ( SymmetricKeyAlgorithmTag encAlgorithm ) : System
encAlgorithm SymmetricKeyAlgorithmTag
리턴 System

PgpEncryptedDataGenerator() 공개 메소드

Existing SecureRandom constructor.
public PgpEncryptedDataGenerator ( SymmetricKeyAlgorithmTag encAlgorithm, SecureRandom rand ) : System
encAlgorithm SymmetricKeyAlgorithmTag The symmetric algorithm to use.
rand Org.BouncyCastle.Security.SecureRandom Source of randomness.
리턴 System

PgpEncryptedDataGenerator() 공개 메소드

Base constructor.
public PgpEncryptedDataGenerator ( SymmetricKeyAlgorithmTag encAlgorithm, SecureRandom rand, bool oldFormat ) : System
encAlgorithm SymmetricKeyAlgorithmTag The symmetric algorithm to use.
rand Org.BouncyCastle.Security.SecureRandom Source of randomness.
oldFormat bool PGP 2.6.x compatibility required.
리턴 System

PgpEncryptedDataGenerator() 공개 메소드

public PgpEncryptedDataGenerator ( SymmetricKeyAlgorithmTag encAlgorithm, bool withIntegrityPacket ) : System
encAlgorithm SymmetricKeyAlgorithmTag
withIntegrityPacket bool
리턴 System

PgpEncryptedDataGenerator() 공개 메소드

Creates a cipher stream which will have an integrity packet associated with it.
public PgpEncryptedDataGenerator ( SymmetricKeyAlgorithmTag encAlgorithm, bool withIntegrityPacket, SecureRandom rand ) : System
encAlgorithm SymmetricKeyAlgorithmTag
withIntegrityPacket bool
rand Org.BouncyCastle.Security.SecureRandom
리턴 System