Class Auth
SorobanAuthorizationEntry
.- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A signature, consisting of a public key and a signature.static interface
An interface for signing aHashIDPreimage
to produce a signature. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SorobanAuthorizationEntry
authorizeEntry
(String entry, Auth.Signer signer, Long validUntilLedgerSeq, Network network) Actually authorizes an existing authorization entry using the given the credentials and expiration details, returning a signed copy.static SorobanAuthorizationEntry
authorizeEntry
(String entry, KeyPair signer, Long validUntilLedgerSeq, Network network) Actually authorizes an existing authorization entry using the given the credentials and expiration details, returning a signed copy.static SorobanAuthorizationEntry
authorizeEntry
(SorobanAuthorizationEntry entry, Auth.Signer signer, Long validUntilLedgerSeq, Network network) Actually authorizes an existing authorization entry using the given the credentials and expiration details, returning a signed copy.static SorobanAuthorizationEntry
authorizeEntry
(SorobanAuthorizationEntry entry, KeyPair signer, Long validUntilLedgerSeq, Network network) Actually authorizes an existing authorization entry using the given the credentials and expiration details, returning a signed copy.static SorobanAuthorizationEntry
authorizeInvocation
(Auth.Signer signer, String publicKey, Long validUntilLedgerSeq, SorobanAuthorizedInvocation invocation, Network network) This builds an entry from scratch, allowing you to express authorization as a function of: a particular identity (i.e.static SorobanAuthorizationEntry
authorizeInvocation
(KeyPair signer, Long validUntilLedgerSeq, SorobanAuthorizedInvocation invocation, Network network) This builds an entry from scratch, allowing you to express authorization as a function of: a particular identity (i.e.
-
Constructor Details
-
Auth
public Auth()
-
-
Method Details
-
authorizeEntry
public static SorobanAuthorizationEntry authorizeEntry(String entry, KeyPair signer, Long validUntilLedgerSeq, Network network) Actually authorizes an existing authorization entry using the given the credentials and expiration details, returning a signed copy.This "fills out" the authorization entry with a signature, indicating to the
InvokeHostFunctionOperation
it's attached to that:- a particular identity (i.e. signing
KeyPair
orAuth.Signer
) - approving the execution of an invocation tree (i.e. a simulation-acquired
SorobanAuthorizedInvocation
or otherwise built) - on a particular network (uniquely identified by its passphrase, see
Network
) - until a particular ledger sequence is reached.
- Parameters:
entry
- a base64 encoded unsigned Soroban authorization entrysigner
- aKeyPair
which should correspond to the address in the `entry`validUntilLedgerSeq
- the (exclusive) future ledger sequence number until which this authorization entry should be valid (if `currentLedgerSeq==validUntil`, this is expired)network
- the network is incorprated into the signature- Returns:
- a signed Soroban authorization entry
- a particular identity (i.e. signing
-
authorizeEntry
public static SorobanAuthorizationEntry authorizeEntry(SorobanAuthorizationEntry entry, KeyPair signer, Long validUntilLedgerSeq, Network network) Actually authorizes an existing authorization entry using the given the credentials and expiration details, returning a signed copy.This "fills out" the authorization entry with a signature, indicating to the
InvokeHostFunctionOperation
it's attached to that:- a particular identity (i.e. signing
KeyPair
orAuth.Signer
) - approving the execution of an invocation tree (i.e. a simulation-acquired
SorobanAuthorizedInvocation
or otherwise built) - on a particular network (uniquely identified by its passphrase, see
Network
) - until a particular ledger sequence is reached.
- Parameters:
entry
- a base64 encoded unsigned Soroban authorization entrysigner
- aKeyPair
which should correspond to the address in the `entry`validUntilLedgerSeq
- the (exclusive) future ledger sequence number until which this authorization entry should be valid (if `currentLedgerSeq==validUntil`, this is expired)network
- the network is incorprated into the signature- Returns:
- a signed Soroban authorization entry
- a particular identity (i.e. signing
-
authorizeEntry
public static SorobanAuthorizationEntry authorizeEntry(String entry, Auth.Signer signer, Long validUntilLedgerSeq, Network network) Actually authorizes an existing authorization entry using the given the credentials and expiration details, returning a signed copy.This "fills out" the authorization entry with a signature, indicating to the
InvokeHostFunctionOperation
it's attached to that:- a particular identity (i.e. signing
KeyPair
orAuth.Signer
) - approving the execution of an invocation tree (i.e. a simulation-acquired
SorobanAuthorizedInvocation
or otherwise built) - on a particular network (uniquely identified by its passphrase, see
Network
) - until a particular ledger sequence is reached.
- Parameters:
entry
- a base64 encoded unsigned Soroban authorization entrysigner
- A function which takes a payload (aHashIDPreimage
) and returns the signature of the hash of the raw payload bytes, seeAuth.Signer
validUntilLedgerSeq
- the (exclusive) future ledger sequence number until which this authorization entry should be valid (if `currentLedgerSeq==validUntil`, this is expired)network
- the network is incorprated into the signature- Returns:
- a signed Soroban authorization entry
- a particular identity (i.e. signing
-
authorizeEntry
public static SorobanAuthorizationEntry authorizeEntry(SorobanAuthorizationEntry entry, Auth.Signer signer, Long validUntilLedgerSeq, Network network) Actually authorizes an existing authorization entry using the given the credentials and expiration details, returning a signed copy.This "fills out" the authorization entry with a signature, indicating to the
InvokeHostFunctionOperation
it's attached to that:- a particular identity (i.e. signing
KeyPair
orAuth.Signer
) - approving the execution of an invocation tree (i.e. a simulation-acquired
SorobanAuthorizedInvocation
or otherwise built) - on a particular network (uniquely identified by its passphrase, see
Network
) - until a particular ledger sequence is reached.
- Parameters:
entry
- an unsigned Soroban authorization entrysigner
- A function which takes a payload (aHashIDPreimage
) and returns the signature of the hash of the raw payload bytes, seeAuth.Signer
validUntilLedgerSeq
- the (exclusive) future ledger sequence number until which this authorization entry should be valid (if `currentLedgerSeq==validUntil`, this is expired)network
- the network is incorprated into the signature- Returns:
- a signed Soroban authorization entry
- a particular identity (i.e. signing
-
authorizeInvocation
public static SorobanAuthorizationEntry authorizeInvocation(KeyPair signer, Long validUntilLedgerSeq, SorobanAuthorizedInvocation invocation, Network network) This builds an entry from scratch, allowing you to express authorization as a function of:- a particular identity (i.e. signing
KeyPair
orAuth.Signer
) - approving the execution of an invocation tree (i.e. a simulation-acquired
SorobanAuthorizedInvocation
or otherwise built) - on a particular network (uniquely identified by its passphrase, see
Network
) - until a particular ledger sequence is reached.
This is in contrast to
authorizeEntry(java.lang.String, org.stellar.sdk.KeyPair, java.lang.Long, org.stellar.sdk.Network)
, which signs an existing entry "in place".- Parameters:
signer
- aKeyPair
used to sign the entryvalidUntilLedgerSeq
- the (exclusive) future ledger sequence number until which this authorization entry should be valid (if `currentLedgerSeq==validUntil`, this is expired)invocation
- invocation the invocation tree that we're authorizing (likely, this comes from transaction simulation)network
- the network is incorprated into the signature- Returns:
- a signed Soroban authorization entry
- a particular identity (i.e. signing
-
authorizeInvocation
public static SorobanAuthorizationEntry authorizeInvocation(Auth.Signer signer, String publicKey, Long validUntilLedgerSeq, SorobanAuthorizedInvocation invocation, Network network) This builds an entry from scratch, allowing you to express authorization as a function of:- a particular identity (i.e. signing
KeyPair
orAuth.Signer
) - approving the execution of an invocation tree (i.e. a simulation-acquired
SorobanAuthorizedInvocation
or otherwise built) - on a particular network (uniquely identified by its passphrase, see
Network
) - until a particular ledger sequence is reached.
This is in contrast to
authorizeEntry(java.lang.String, org.stellar.sdk.KeyPair, java.lang.Long, org.stellar.sdk.Network)
, which signs an existing entry "in place".- Parameters:
signer
- A function which takes a payload (aHashIDPreimage
) and returns the signature of the hash of the raw payload bytes, seeAuth.Signer
publicKey
- the public identity of the signervalidUntilLedgerSeq
- the (exclusive) future ledger sequence number until which this authorization entry should be valid (if `currentLedgerSeq==validUntil`, this is expired)invocation
- invocation the invocation tree that we're authorizing (likely, this comes from transaction simulation)network
- the network is incorprated into the signature- Returns:
- a signed Soroban authorization entry
- a particular identity (i.e. signing
-