Rename com.r3corda -> net.corda

This commit is contained in:
Mike Hearn
2016-11-10 14:14:38 +01:00
parent 91c5f2ff57
commit ce99f354cb
4022 changed files with 2476 additions and 158936 deletions

View File

@ -1,4 +1,4 @@
package com.r3corda.core.crypto;
package net.corda.core.crypto;
public class AddressFormatException extends IllegalArgumentException {
public AddressFormatException() {

View File

@ -1,4 +1,4 @@
package com.r3corda.core.crypto;
package net.corda.core.crypto;
import java.math.*;
import java.util.*;

View File

@ -1,4 +1,4 @@
package com.r3corda.core
package net.corda.core
import com.google.common.base.Function
import com.google.common.base.Throwables
@ -7,7 +7,7 @@ import com.google.common.util.concurrent.Futures
import com.google.common.util.concurrent.ListenableFuture
import com.google.common.util.concurrent.MoreExecutors
import com.google.common.util.concurrent.SettableFuture
import com.r3corda.core.crypto.newSecureRandom
import net.corda.core.crypto.newSecureRandom
import kotlinx.support.jdk7.use
import org.slf4j.Logger
import rx.Observable

View File

@ -1,7 +1,7 @@
package com.r3corda.core.contracts
package net.corda.core.contracts
import com.r3corda.core.crypto.Party
import com.r3corda.core.serialization.OpaqueBytes
import net.corda.core.crypto.Party
import net.corda.core.serialization.OpaqueBytes
import java.security.PublicKey
import java.util.*

View File

@ -1,7 +1,7 @@
@file:JvmName("ContractsDSL")
package com.r3corda.core.contracts
package net.corda.core.contracts
import com.r3corda.core.crypto.Party
import net.corda.core.crypto.Party
import java.security.PublicKey
import java.util.*

View File

@ -1,8 +1,8 @@
package com.r3corda.core.contracts
package net.corda.core.contracts
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.transactions.TransactionBuilder
import net.corda.core.crypto.Party
import net.corda.core.crypto.SecureHash
import net.corda.core.transactions.TransactionBuilder
import java.security.PublicKey
// The dummy contract doesn't do anything useful. It exists for testing purposes.

View File

@ -1,4 +1,4 @@
package com.r3corda.core.contracts
package net.corda.core.contracts
import java.security.PublicKey
@ -9,4 +9,4 @@ data class DummyState(val magicNumber: Int = 0) : ContractState {
override val contract = DUMMY_PROGRAM_ID
override val participants: List<PublicKey>
get() = emptyList()
}
}

View File

@ -1,4 +1,4 @@
package com.r3corda.core.contracts
package net.corda.core.contracts
import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.core.JsonParser

View File

@ -1,4 +1,4 @@
package com.r3corda.core.contracts
package net.corda.core.contracts
import java.security.PublicKey

View File

@ -1,15 +1,15 @@
package com.r3corda.core.contracts
package net.corda.core.contracts
import com.r3corda.core.contracts.clauses.Clause
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.crypto.toStringShort
import com.r3corda.core.node.services.ServiceType
import com.r3corda.core.protocols.ProtocolLogicRef
import com.r3corda.core.protocols.ProtocolLogicRefFactory
import com.r3corda.core.serialization.OpaqueBytes
import com.r3corda.core.serialization.serialize
import com.r3corda.core.transactions.TransactionBuilder
import net.corda.core.contracts.clauses.Clause
import net.corda.core.crypto.Party
import net.corda.core.crypto.SecureHash
import net.corda.core.crypto.toStringShort
import net.corda.core.node.services.ServiceType
import net.corda.core.protocols.ProtocolLogicRef
import net.corda.core.protocols.ProtocolLogicRefFactory
import net.corda.core.serialization.OpaqueBytes
import net.corda.core.serialization.serialize
import net.corda.core.transactions.TransactionBuilder
import java.io.FileNotFoundException
import java.io.InputStream
import java.io.OutputStream

View File

@ -1,9 +1,9 @@
package com.r3corda.core.contracts
package net.corda.core.contracts
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.node.services.ReadOnlyTransactionStorage
import com.r3corda.core.transactions.SignedTransaction
import com.r3corda.core.transactions.WireTransaction
import net.corda.core.crypto.SecureHash
import net.corda.core.node.services.ReadOnlyTransactionStorage
import net.corda.core.transactions.SignedTransaction
import net.corda.core.transactions.WireTransaction
import java.util.*
import java.util.concurrent.Callable

View File

@ -1,8 +1,8 @@
package com.r3corda.core.contracts
package net.corda.core.contracts
import com.r3corda.core.crypto.Party
import com.r3corda.core.transactions.LedgerTransaction
import com.r3corda.core.transactions.TransactionBuilder
import net.corda.core.crypto.Party
import net.corda.core.transactions.LedgerTransaction
import net.corda.core.transactions.TransactionBuilder
import java.security.PublicKey
/** Defines transaction build & validation logic for a specific transaction type */

View File

@ -1,9 +1,9 @@
package com.r3corda.core.contracts
package net.corda.core.contracts
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.crypto.toStringShort
import com.r3corda.core.transactions.LedgerTransaction
import net.corda.core.crypto.Party
import net.corda.core.crypto.SecureHash
import net.corda.core.crypto.toStringShort
import net.corda.core.transactions.LedgerTransaction
import java.security.PublicKey
import java.util.*

View File

@ -1,9 +1,9 @@
package com.r3corda.core.contracts.clauses
package net.corda.core.contracts.clauses
import com.r3corda.core.contracts.AuthenticatedObject
import com.r3corda.core.contracts.CommandData
import com.r3corda.core.contracts.ContractState
import com.r3corda.core.contracts.TransactionForContract
import net.corda.core.contracts.AuthenticatedObject
import net.corda.core.contracts.CommandData
import net.corda.core.contracts.ContractState
import net.corda.core.contracts.TransactionForContract
import java.util.*
/**
@ -36,4 +36,4 @@ class AllComposition<S : ContractState, C : CommandData, K : Any>(firstClause: C
}
override fun toString() = "All: $clauses.toList()"
}
}

View File

@ -1,9 +1,9 @@
package com.r3corda.core.contracts.clauses
package net.corda.core.contracts.clauses
import com.r3corda.core.contracts.AuthenticatedObject
import com.r3corda.core.contracts.CommandData
import com.r3corda.core.contracts.ContractState
import com.r3corda.core.contracts.TransactionForContract
import net.corda.core.contracts.AuthenticatedObject
import net.corda.core.contracts.CommandData
import net.corda.core.contracts.ContractState
import net.corda.core.contracts.TransactionForContract
import java.util.*
/**
@ -22,4 +22,4 @@ class AnyComposition<in S : ContractState, C : CommandData, in K : Any>(vararg r
}
override fun toString(): String = "Or: ${clauses.toList()}"
}
}

View File

@ -1,10 +1,10 @@
package com.r3corda.core.contracts.clauses
package net.corda.core.contracts.clauses
import com.r3corda.core.contracts.AuthenticatedObject
import com.r3corda.core.contracts.CommandData
import com.r3corda.core.contracts.ContractState
import com.r3corda.core.contracts.TransactionForContract
import com.r3corda.core.utilities.loggerFor
import net.corda.core.contracts.AuthenticatedObject
import net.corda.core.contracts.CommandData
import net.corda.core.contracts.ContractState
import net.corda.core.contracts.TransactionForContract
import net.corda.core.utilities.loggerFor
/**
* A clause of a contract, containing a chunk of verification logic. That logic may be delegated to other clauses, or
@ -66,4 +66,4 @@ fun <C : CommandData> Clause<*, C, *>.matches(commands: List<AuthenticatedObject
true
else
commands.map { it.value.javaClass }.toSet().containsAll(requiredCommands)
}
}

View File

@ -1,7 +1,7 @@
@file:JvmName("ClauseVerifier")
package com.r3corda.core.contracts.clauses
package net.corda.core.contracts.clauses
import com.r3corda.core.contracts.*
import net.corda.core.contracts.*
/**
* Verify a transaction against the given list of clauses.
@ -22,4 +22,4 @@ fun <C: CommandData> verifyClause(tx: TransactionForContract,
val matchedCommands = clause.verify(tx, tx.inputs, tx.outputs, commands, null)
check(matchedCommands.containsAll(commands.map { it.value })) { "The following commands were not matched at the end of execution: " + (commands - matchedCommands) }
}
}

View File

@ -1,8 +1,8 @@
package com.r3corda.core.contracts.clauses
package net.corda.core.contracts.clauses
import com.r3corda.core.contracts.AuthenticatedObject
import com.r3corda.core.contracts.CommandData
import com.r3corda.core.contracts.ContractState
import net.corda.core.contracts.AuthenticatedObject
import net.corda.core.contracts.CommandData
import net.corda.core.contracts.ContractState
/**
* Abstract supertype for clauses which compose other clauses together in some logical manner.
@ -14,4 +14,4 @@ abstract class CompositeClause<in S : ContractState, C: CommandData, in K : Any>
= matchedClauses(commands).flatMap { it.getExecutionPath(commands) }
/** Determine which clauses are matched by the supplied commands */
abstract fun matchedClauses(commands: List<AuthenticatedObject<C>>): List<Clause<S, C, K>>
}
}

View File

@ -1,9 +1,9 @@
package com.r3corda.core.contracts.clauses
package net.corda.core.contracts.clauses
import com.r3corda.core.contracts.AuthenticatedObject
import com.r3corda.core.contracts.CommandData
import com.r3corda.core.contracts.ContractState
import com.r3corda.core.contracts.TransactionForContract
import net.corda.core.contracts.AuthenticatedObject
import net.corda.core.contracts.CommandData
import net.corda.core.contracts.ContractState
import net.corda.core.contracts.TransactionForContract
/**
* Filter the states that are passed through to the wrapped clause, to restrict them to a specific type.
@ -22,4 +22,4 @@ class FilterOn<S : ContractState, C : CommandData, K : Any>(val clause: Clause<S
commands: List<AuthenticatedObject<C>>,
groupingKey: K?): Set<C>
= clause.verify(tx, filterStates(inputs), filterStates(outputs), commands, groupingKey)
}
}

View File

@ -1,10 +1,10 @@
package com.r3corda.core.contracts.clauses
package net.corda.core.contracts.clauses
import com.r3corda.core.contracts.AuthenticatedObject
import com.r3corda.core.contracts.CommandData
import com.r3corda.core.contracts.ContractState
import com.r3corda.core.contracts.TransactionForContract
import com.r3corda.core.utilities.loggerFor
import net.corda.core.contracts.AuthenticatedObject
import net.corda.core.contracts.CommandData
import net.corda.core.contracts.ContractState
import net.corda.core.contracts.TransactionForContract
import net.corda.core.utilities.loggerFor
import java.util.*
/**
@ -30,4 +30,4 @@ class FirstComposition<S : ContractState, C : CommandData, K : Any>(val firstCla
}
override fun toString() = "First: ${clauses.toList()}"
}
}

View File

@ -1,9 +1,9 @@
package com.r3corda.core.contracts.clauses
package net.corda.core.contracts.clauses
import com.r3corda.core.contracts.AuthenticatedObject
import com.r3corda.core.contracts.CommandData
import com.r3corda.core.contracts.ContractState
import com.r3corda.core.contracts.TransactionForContract
import net.corda.core.contracts.AuthenticatedObject
import net.corda.core.contracts.CommandData
import net.corda.core.contracts.ContractState
import net.corda.core.contracts.TransactionForContract
import java.util.*
abstract class GroupClauseVerifier<S : ContractState, C : CommandData, K : Any>(val clause: Clause<S, C, K>) : Clause<ContractState, C, Unit>() {
@ -26,4 +26,4 @@ abstract class GroupClauseVerifier<S : ContractState, C : CommandData, K : Any>(
return matchedCommands
}
}
}

View File

@ -1,4 +1,4 @@
package com.r3corda.core.math
package net.corda.core.math
import java.util.*

View File

@ -1,12 +1,12 @@
package com.r3corda.core.messaging
package net.corda.core.messaging
import com.google.common.util.concurrent.ListenableFuture
import com.google.common.util.concurrent.SettableFuture
import com.r3corda.core.catch
import com.r3corda.core.node.services.DEFAULT_SESSION_ID
import com.r3corda.core.serialization.DeserializeAsKotlinObjectDef
import com.r3corda.core.serialization.deserialize
import com.r3corda.core.serialization.serialize
import net.corda.core.catch
import net.corda.core.node.services.DEFAULT_SESSION_ID
import net.corda.core.serialization.DeserializeAsKotlinObjectDef
import net.corda.core.serialization.deserialize
import net.corda.core.serialization.serialize
import java.time.Instant
import java.util.*
import java.util.concurrent.atomic.AtomicBoolean
@ -204,4 +204,4 @@ interface AllPossibleRecipients : MessageRecipients
* A general Ack message that conveys no content other than it's presence for use when you want an acknowledgement
* from a recipient. Using [Unit] can be ambiguous as it is similar to [Void] and so could mean no response.
*/
object Ack : DeserializeAsKotlinObjectDef
object Ack : DeserializeAsKotlinObjectDef

View File

@ -1,7 +1,7 @@
package com.r3corda.core.node
package net.corda.core.node
import com.r3corda.core.contracts.Attachment
import com.r3corda.core.crypto.SecureHash
import net.corda.core.contracts.Attachment
import net.corda.core.crypto.SecureHash
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.io.FileNotFoundException

View File

@ -1,7 +1,7 @@
package com.r3corda.core.node
package net.corda.core.node
/**
* Implement this interface on a class advertised in a META-INF/services/com.r3corda.core.node.CordaPluginRegistry file
* Implement this interface on a class advertised in a META-INF/services/net.corda.core.node.CordaPluginRegistry file
* to extend a Corda node with additional application services.
*/
abstract class CordaPluginRegistry {

View File

@ -1,9 +1,9 @@
package com.r3corda.core.node
package net.corda.core.node
import com.r3corda.core.crypto.Party
import com.r3corda.core.messaging.SingleMessageRecipient
import com.r3corda.core.node.services.ServiceInfo
import com.r3corda.core.node.services.ServiceType
import net.corda.core.crypto.Party
import net.corda.core.messaging.SingleMessageRecipient
import net.corda.core.node.services.ServiceInfo
import net.corda.core.node.services.ServiceType
/**
* Information for an advertised service including the service specific identity information.
@ -20,4 +20,4 @@ data class NodeInfo(val address: SingleMessageRecipient,
val physicalLocation: PhysicalLocation? = null) {
val notaryIdentity: Party get() = advertisedServices.single { it.info.type.isNotary() }.identity
fun serviceIdentities(type: ServiceType): List<Party> = advertisedServices.filter { it.info.type.isSubTypeOf(type) }.map { it.identity }
}
}

View File

@ -1,4 +1,4 @@
package com.r3corda.core.node
package net.corda.core.node
import java.util.*
@ -58,4 +58,4 @@ object CityDatabase {
}
operator fun get(name: String) = cityMap[name.toLowerCase()]
}
}

View File

@ -1,7 +1,7 @@
package com.r3corda.core.node
package net.corda.core.node
import com.r3corda.core.crypto.Party
import com.r3corda.core.protocols.ProtocolLogic
import net.corda.core.crypto.Party
import net.corda.core.protocols.ProtocolLogic
import kotlin.reflect.KClass
/**

View File

@ -1,13 +1,13 @@
package com.r3corda.core.node
package net.corda.core.node
import com.google.common.util.concurrent.ListenableFuture
import com.r3corda.core.transactions.SignedTransaction
import com.r3corda.core.contracts.StateRef
import com.r3corda.core.contracts.TransactionResolutionException
import com.r3corda.core.contracts.TransactionState
import com.r3corda.core.messaging.MessagingService
import com.r3corda.core.node.services.*
import com.r3corda.core.protocols.ProtocolLogic
import net.corda.core.transactions.SignedTransaction
import net.corda.core.contracts.StateRef
import net.corda.core.contracts.TransactionResolutionException
import net.corda.core.contracts.TransactionState
import net.corda.core.messaging.MessagingService
import net.corda.core.node.services.*
import net.corda.core.protocols.ProtocolLogic
import java.security.KeyPair
import java.time.Clock
@ -78,4 +78,4 @@ interface ServiceHub {
*
* @param txs The transactions to record.
*/
fun ServiceHub.recordTransactions(vararg txs: SignedTransaction) = recordTransactions(txs.toList())
fun ServiceHub.recordTransactions(vararg txs: SignedTransaction) = recordTransactions(txs.toList())

View File

@ -1,7 +1,7 @@
package com.r3corda.core.node.services
package net.corda.core.node.services
import com.r3corda.core.contracts.Attachment
import com.r3corda.core.crypto.SecureHash
import net.corda.core.contracts.Attachment
import net.corda.core.crypto.SecureHash
import java.io.InputStream
/**

View File

@ -1,6 +1,6 @@
package com.r3corda.core.node.services
package net.corda.core.node.services
import com.r3corda.core.crypto.Party
import net.corda.core.crypto.Party
import java.security.PublicKey
/**

View File

@ -1,12 +1,12 @@
package com.r3corda.core.node.services
package net.corda.core.node.services
import com.google.common.annotations.VisibleForTesting
import com.google.common.util.concurrent.ListenableFuture
import com.r3corda.core.contracts.Contract
import com.r3corda.core.crypto.Party
import com.r3corda.core.messaging.MessagingService
import com.r3corda.core.messaging.SingleMessageRecipient
import com.r3corda.core.node.NodeInfo
import net.corda.core.contracts.Contract
import net.corda.core.crypto.Party
import net.corda.core.messaging.MessagingService
import net.corda.core.messaging.SingleMessageRecipient
import net.corda.core.node.NodeInfo
import org.slf4j.LoggerFactory
import rx.Observable
import java.security.PublicKey

View File

@ -1,4 +1,4 @@
package com.r3corda.core.node.services
package net.corda.core.node.services
/**
* A container for additional information for an advertised service.
@ -21,4 +21,4 @@ data class ServiceInfo(val type: ServiceType, val name: String? = null) {
override fun toString() = if (name != null) "$type|$name" else type.toString()
}
fun Iterable<ServiceInfo>.containsType(type: ServiceType) = any { it.type == type }
fun Iterable<ServiceInfo>.containsType(type: ServiceType) = any { it.type == type }

View File

@ -1,4 +1,4 @@
package com.r3corda.core.node.services
package net.corda.core.node.services
/**
* Identifier for service types a node can expose over the network to other peers. These types are placed into network
@ -28,7 +28,7 @@ sealed class ServiceType(val id: String) {
get() {
val stack = Throwable().stackTrace
val caller = stack.first().className
require(caller.startsWith("com.r3corda.")) { "Corda ServiceType namespace is reserved for Corda core components" }
require(caller.startsWith("net.corda.")) { "Corda ServiceType namespace is reserved for Corda core components" }
return ServiceTypeDirect("corda")
}
@ -52,4 +52,4 @@ sealed class ServiceType(val id: String) {
override fun hashCode(): Int = id.hashCode()
override fun toString(): String = id.toString()
}
}

View File

@ -1,12 +1,12 @@
package com.r3corda.core.node.services
package net.corda.core.node.services
import com.google.common.util.concurrent.ListenableFuture
import com.google.common.util.concurrent.SettableFuture
import com.r3corda.core.contracts.*
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.transactions.TransactionBuilder
import com.r3corda.core.transactions.WireTransaction
import net.corda.core.contracts.*
import net.corda.core.crypto.Party
import net.corda.core.crypto.SecureHash
import net.corda.core.transactions.TransactionBuilder
import net.corda.core.transactions.WireTransaction
import rx.Observable
import java.security.KeyPair
import java.security.PrivateKey

View File

@ -1,7 +1,7 @@
package com.r3corda.core.node.services
package net.corda.core.node.services
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.protocols.StateMachineRunId
import net.corda.core.crypto.SecureHash
import net.corda.core.protocols.StateMachineRunId
import rx.Observable
data class StateMachineTransactionMapping(val stateMachineRunId: StateMachineRunId, val transactionId: SecureHash)

View File

@ -1,8 +1,8 @@
package com.r3corda.core.node.services
package net.corda.core.node.services
import com.r3corda.core.contracts.Timestamp
import com.r3corda.core.seconds
import com.r3corda.core.until
import net.corda.core.contracts.Timestamp
import net.corda.core.seconds
import net.corda.core.until
import java.time.Clock
import java.time.Duration

View File

@ -1,7 +1,7 @@
package com.r3corda.core.node.services
package net.corda.core.node.services
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.transactions.SignedTransaction
import net.corda.core.crypto.SecureHash
import net.corda.core.transactions.SignedTransaction
import rx.Observable
/**

View File

@ -1,8 +1,8 @@
package com.r3corda.core.node.services
package net.corda.core.node.services
import com.r3corda.core.contracts.StateRef
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.SecureHash
import net.corda.core.contracts.StateRef
import net.corda.core.crypto.Party
import net.corda.core.crypto.SecureHash
/**
* A service that records input states of the given transaction and provides conflict information

View File

@ -1,10 +1,10 @@
package com.r3corda.core.protocols
package net.corda.core.protocols
import co.paralleluniverse.fibers.Suspendable
import com.r3corda.core.crypto.Party
import com.r3corda.core.node.ServiceHub
import com.r3corda.core.utilities.ProgressTracker
import com.r3corda.core.utilities.UntrustworthyData
import net.corda.core.crypto.Party
import net.corda.core.node.ServiceHub
import net.corda.core.utilities.ProgressTracker
import net.corda.core.utilities.UntrustworthyData
import org.slf4j.Logger
import rx.Observable

View File

@ -1,10 +1,10 @@
package com.r3corda.core.protocols
package net.corda.core.protocols
import com.google.common.primitives.Primitives
import com.r3corda.core.contracts.StateRef
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.serialization.SingletonSerializeAsToken
import com.r3corda.protocols.TwoPartyDealProtocol
import net.corda.core.contracts.StateRef
import net.corda.core.crypto.SecureHash
import net.corda.core.serialization.SingletonSerializeAsToken
import net.corda.protocols.TwoPartyDealProtocol
import java.lang.reflect.ParameterizedType
import java.lang.reflect.Type
import java.time.Duration

View File

@ -1,10 +1,10 @@
package com.r3corda.core.protocols
package net.corda.core.protocols
import co.paralleluniverse.fibers.Suspendable
import com.google.common.util.concurrent.ListenableFuture
import com.r3corda.core.crypto.Party
import com.r3corda.core.node.ServiceHub
import com.r3corda.core.utilities.UntrustworthyData
import net.corda.core.crypto.Party
import net.corda.core.node.ServiceHub
import net.corda.core.utilities.UntrustworthyData
import org.slf4j.Logger
import java.util.*
@ -48,4 +48,4 @@ interface ProtocolStateMachine<R> {
val resultFuture: ListenableFuture<R>
}
class ProtocolSessionException(message: String) : Exception(message)
class ProtocolSessionException(message: String) : Exception(message)

View File

@ -1,8 +1,8 @@
package com.r3corda.core.schemas
package net.corda.core.schemas
import com.r3corda.core.contracts.ContractState
import com.r3corda.core.contracts.StateRef
import com.r3corda.core.serialization.toHexString
import net.corda.core.contracts.ContractState
import net.corda.core.contracts.StateRef
import net.corda.core.serialization.toHexString
import java.io.Serializable
import javax.persistence.Column
import javax.persistence.Embeddable

View File

@ -1,4 +1,4 @@
package com.r3corda.core.serialization
package net.corda.core.serialization
import com.google.common.io.BaseEncoding
import java.io.ByteArrayInputStream
@ -35,4 +35,4 @@ open class OpaqueBytes(val bits: ByteArray) {
fun ByteArray.opaque(): OpaqueBytes = OpaqueBytes(this)
fun ByteArray.toHexString() = BaseEncoding.base16().encode(this)
fun String.parseAsHex() = BaseEncoding.base16().decode(this)
fun String.parseAsHex() = BaseEncoding.base16().decode(this)

View File

@ -1,4 +1,4 @@
package com.r3corda.core.serialization
package net.corda.core.serialization
import co.paralleluniverse.fibers.Fiber
import co.paralleluniverse.io.serialization.kryo.KryoSerializer
@ -10,16 +10,17 @@ import com.esotericsoftware.kryo.io.Input
import com.esotericsoftware.kryo.io.Output
import com.esotericsoftware.kryo.serializers.JavaSerializer
import com.esotericsoftware.kryo.serializers.MapSerializer
import com.r3corda.core.contracts.*
import com.r3corda.core.crypto.*
import com.r3corda.core.node.AttachmentsClassLoader
import com.r3corda.core.node.services.AttachmentStorage
import com.r3corda.core.transactions.SignedTransaction
import com.r3corda.core.transactions.WireTransaction
import com.r3corda.core.utilities.NonEmptySet
import com.r3corda.core.utilities.NonEmptySetSerializer
import net.corda.core.contracts.*
import net.corda.core.crypto.*
import net.corda.core.node.AttachmentsClassLoader
import net.corda.core.node.services.AttachmentStorage
import net.corda.core.transactions.SignedTransaction
import net.corda.core.transactions.WireTransaction
import net.corda.core.utilities.NonEmptySet
import net.corda.core.utilities.NonEmptySetSerializer
import de.javakaffee.kryoserializers.ArraysAsListSerializer
import de.javakaffee.kryoserializers.guava.*
import net.corda.core.crypto.*
import net.i2p.crypto.eddsa.EdDSAPrivateKey
import net.i2p.crypto.eddsa.EdDSAPublicKey
import net.i2p.crypto.eddsa.spec.EdDSAPrivateKeySpec

View File

@ -1,4 +1,4 @@
package com.r3corda.core.serialization
package net.corda.core.serialization
import com.esotericsoftware.kryo.Kryo
import com.esotericsoftware.kryo.KryoException

View File

@ -1,15 +1,15 @@
package com.r3corda.core.testing
package net.corda.core.testing
import com.pholser.junit.quickcheck.generator.GenerationStatus
import com.pholser.junit.quickcheck.generator.Generator
import com.pholser.junit.quickcheck.generator.java.lang.StringGenerator
import com.pholser.junit.quickcheck.generator.java.util.ArrayListGenerator
import com.pholser.junit.quickcheck.random.SourceOfRandomness
import com.r3corda.core.contracts.*
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.crypto.entropyToKeyPair
import com.r3corda.core.serialization.OpaqueBytes
import net.corda.core.contracts.*
import net.corda.core.crypto.Party
import net.corda.core.crypto.SecureHash
import net.corda.core.crypto.entropyToKeyPair
import net.corda.core.serialization.OpaqueBytes
import java.security.PrivateKey
import java.security.PublicKey
import java.time.Duration

View File

@ -1,7 +1,7 @@
package com.r3corda.core.transactions
package net.corda.core.transactions
import com.r3corda.core.contracts.*
import com.r3corda.core.crypto.Party
import net.corda.core.contracts.*
import net.corda.core.crypto.Party
import java.security.PublicKey
import java.util.*
@ -50,4 +50,4 @@ abstract class BaseTransaction(
timestamp == other.timestamp
override fun hashCode() = Objects.hash(notary, mustSign, type, timestamp)
}
}

View File

@ -1,8 +1,8 @@
package com.r3corda.core.transactions
package net.corda.core.transactions
import com.r3corda.core.contracts.*
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.SecureHash
import net.corda.core.contracts.*
import net.corda.core.crypto.Party
import net.corda.core.crypto.SecureHash
import java.security.PublicKey
/**
@ -81,4 +81,4 @@ class LedgerTransaction(
result = 31 * result + id.hashCode()
return result
}
}
}

View File

@ -1,11 +1,15 @@
package com.r3corda.core.transactions
package net.corda.core.transactions
import com.r3corda.core.contracts.Command
import com.r3corda.core.contracts.ContractState
import com.r3corda.core.contracts.StateRef
import com.r3corda.core.contracts.TransactionState
import com.r3corda.core.crypto.*
import com.r3corda.core.serialization.*
import net.corda.core.contracts.Command
import net.corda.core.contracts.ContractState
import net.corda.core.contracts.StateRef
import net.corda.core.contracts.TransactionState
import net.corda.core.crypto.*
import net.corda.core.serialization.*
import net.corda.core.crypto.MerkleTreeException
import net.corda.core.crypto.PartialMerkleTree
import net.corda.core.crypto.SecureHash
import net.corda.core.crypto.sha256
import java.util.*
/**

View File

@ -1,12 +1,12 @@
package com.r3corda.core.transactions
package net.corda.core.transactions
import com.r3corda.core.contracts.NamedByHash
import com.r3corda.core.contracts.TransactionResolutionException
import com.r3corda.core.crypto.DigitalSignature
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.crypto.toStringsShort
import com.r3corda.core.node.ServiceHub
import com.r3corda.core.serialization.SerializedBytes
import net.corda.core.contracts.NamedByHash
import net.corda.core.contracts.TransactionResolutionException
import net.corda.core.crypto.DigitalSignature
import net.corda.core.crypto.SecureHash
import net.corda.core.crypto.toStringsShort
import net.corda.core.node.ServiceHub
import net.corda.core.serialization.SerializedBytes
import java.io.FileNotFoundException
import java.security.PublicKey
import java.security.SignatureException

View File

@ -1,10 +1,11 @@
package com.r3corda.core.transactions
package net.corda.core.transactions
import com.r3corda.core.contracts.*
import com.r3corda.core.crypto.*
import com.r3corda.core.serialization.serialize
import com.r3corda.core.transactions.SignedTransaction
import com.r3corda.core.transactions.WireTransaction
import net.corda.core.contracts.*
import net.corda.core.crypto.*
import net.corda.core.serialization.serialize
import net.corda.core.transactions.SignedTransaction
import net.corda.core.transactions.WireTransaction
import net.corda.core.crypto.*
import java.security.KeyPair
import java.security.PublicKey
import java.time.Duration

View File

@ -1,16 +1,16 @@
package com.r3corda.core.transactions
package net.corda.core.transactions
import com.esotericsoftware.kryo.Kryo
import com.r3corda.core.contracts.*
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.indexOfOrThrow
import com.r3corda.core.node.ServiceHub
import com.r3corda.core.serialization.SerializedBytes
import com.r3corda.core.serialization.THREAD_LOCAL_KRYO
import com.r3corda.core.serialization.deserialize
import com.r3corda.core.serialization.serialize
import com.r3corda.core.utilities.Emoji
import net.corda.core.contracts.*
import net.corda.core.crypto.Party
import net.corda.core.crypto.SecureHash
import net.corda.core.indexOfOrThrow
import net.corda.core.node.ServiceHub
import net.corda.core.serialization.SerializedBytes
import net.corda.core.serialization.THREAD_LOCAL_KRYO
import net.corda.core.serialization.deserialize
import net.corda.core.serialization.serialize
import net.corda.core.utilities.Emoji
import java.io.FileNotFoundException
import java.security.PublicKey

View File

@ -1,8 +1,8 @@
package com.r3corda.core.utilities
package net.corda.core.utilities
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.parsePublicKeyBase58
import com.r3corda.core.node.ServiceHub
import net.corda.core.crypto.Party
import net.corda.core.crypto.parsePublicKeyBase58
import net.corda.core.node.ServiceHub
import javax.ws.rs.core.Response
/**

View File

@ -1,4 +1,4 @@
package com.r3corda.core.utilities
package net.corda.core.utilities
/**
* A simple wrapper class that contains icons and support for printing them only when we're connected to a terminal.
@ -41,4 +41,4 @@ object Emoji {
emojiMode.set(null)
}
}
}
}

View File

@ -1,4 +1,4 @@
package com.r3corda.core.utilities
package net.corda.core.utilities
import org.apache.logging.log4j.Level
import org.apache.logging.log4j.LogManager

View File

@ -1,4 +1,4 @@
package com.r3corda.core.utilities
package net.corda.core.utilities
import com.esotericsoftware.kryo.Kryo
import com.esotericsoftware.kryo.Serializer
@ -112,4 +112,4 @@ object NonEmptySetSerializer : Serializer<NonEmptySet<Any>>() {
for (i in 2..size) { set.add(kryo.readClassAndObject(input)) }
return set
}
}
}

View File

@ -1,6 +1,6 @@
package com.r3corda.core.utilities
package net.corda.core.utilities
import com.r3corda.core.TransientProperty
import net.corda.core.TransientProperty
import rx.Observable
import rx.Subscription
import rx.subjects.BehaviorSubject

View File

@ -1,7 +1,11 @@
@file:JvmName("TestConstants")
package com.r3corda.core.utilities
package net.corda.core.utilities
import com.r3corda.core.crypto.*
import net.corda.core.crypto.*
import net.corda.core.crypto.DummyPublicKey
import net.corda.core.crypto.Party
import net.corda.core.crypto.entropyToKeyPair
import net.corda.core.crypto.generateKeyPair
import java.math.BigInteger
import java.security.KeyPair
import java.security.PublicKey
@ -17,4 +21,4 @@ val DUMMY_KEY_1: KeyPair by lazy { generateKeyPair() }
val DUMMY_KEY_2: KeyPair by lazy { generateKeyPair() }
val DUMMY_NOTARY_KEY: KeyPair by lazy { entropyToKeyPair(BigInteger.valueOf(20)) }
val DUMMY_NOTARY: Party get() = Party("Notary Service", DUMMY_NOTARY_KEY.public)
val DUMMY_NOTARY: Party get() = Party("Notary Service", DUMMY_NOTARY_KEY.public)

View File

@ -1,4 +1,4 @@
package com.r3corda.core.utilities
package net.corda.core.utilities
import java.time.Duration
import java.time.Instant
@ -9,4 +9,4 @@ import java.time.Instant
data class TimeWindow(val start: Instant, val duration: Duration) {
val end: Instant
get() = start + duration
}
}

View File

@ -1,4 +1,4 @@
package com.r3corda.core.utilities
package net.corda.core.utilities
/**
* A small utility to approximate taint tracking: if a method gives you back one of these, it means the data came from

View File

@ -1,6 +1,6 @@
package com.r3corda.core.crypto
package net.corda.core.crypto
import com.r3corda.core.serialization.OpaqueBytes
import net.corda.core.serialization.OpaqueBytes
import net.i2p.crypto.eddsa.EdDSAEngine
import net.i2p.crypto.eddsa.EdDSAPrivateKey
import net.i2p.crypto.eddsa.EdDSAPublicKey

View File

@ -1,7 +1,7 @@
package com.r3corda.core.crypto
package net.corda.core.crypto
import com.r3corda.core.transactions.MerkleTree
import com.r3corda.core.transactions.hashConcat
import net.corda.core.transactions.MerkleTree
import net.corda.core.transactions.hashConcat
import java.util.*

View File

@ -1,7 +1,7 @@
package com.r3corda.core.crypto
package net.corda.core.crypto
import com.r3corda.core.contracts.PartyAndReference
import com.r3corda.core.serialization.OpaqueBytes
import net.corda.core.contracts.PartyAndReference
import net.corda.core.serialization.OpaqueBytes
import java.security.PublicKey
/** A [Party] is well known (name, pubkey) pair. In a real system this would probably be an X.509 certificate. */
@ -10,4 +10,4 @@ data class Party(val name: String, val owningKey: PublicKey) {
fun ref(bytes: OpaqueBytes) = PartyAndReference(this, bytes)
fun ref(vararg bytes: Byte) = ref(OpaqueBytes.of(*bytes))
}
}

View File

@ -1,9 +1,9 @@
package com.r3corda.core.crypto
package net.corda.core.crypto
import com.r3corda.core.crypto.PublicKeyTree.Leaf
import com.r3corda.core.crypto.PublicKeyTree.Node
import com.r3corda.core.serialization.deserialize
import com.r3corda.core.serialization.serialize
import net.corda.core.crypto.PublicKeyTree.Leaf
import net.corda.core.crypto.PublicKeyTree.Node
import net.corda.core.serialization.deserialize
import net.corda.core.serialization.serialize
import java.security.PublicKey
/**
@ -134,4 +134,4 @@ sealed class PublicKeyTree {
}
/** Returns the set of all [PublicKey]s contained in the leaves of the [PublicKeyTree]s */
fun Iterable<PublicKeyTree>.getKeys() = flatMap { it.getKeys() }.toSet()
fun Iterable<PublicKeyTree>.getKeys() = flatMap { it.getKeys() }.toSet()

View File

@ -1,7 +1,7 @@
package com.r3corda.core.crypto
package net.corda.core.crypto
import com.google.common.io.BaseEncoding
import com.r3corda.core.serialization.OpaqueBytes
import net.corda.core.serialization.OpaqueBytes
import java.security.MessageDigest
/**
@ -41,4 +41,4 @@ sealed class SecureHash(bits: ByteArray) : OpaqueBytes(bits) {
}
fun ByteArray.sha256(): SecureHash.SHA256 = SecureHash.sha256(this)
fun OpaqueBytes.sha256(): SecureHash.SHA256 = SecureHash.sha256(this.bits)
fun OpaqueBytes.sha256(): SecureHash.SHA256 = SecureHash.sha256(this.bits)

View File

@ -1,7 +1,7 @@
package com.r3corda.core.crypto
package net.corda.core.crypto
import com.r3corda.core.serialization.SerializedBytes
import com.r3corda.core.serialization.deserialize
import net.corda.core.serialization.SerializedBytes
import net.corda.core.serialization.deserialize
import java.security.SignatureException
/**
@ -36,4 +36,4 @@ open class SignedData<T : Any>(val raw: SerializedBytes<T>, val sig: DigitalSign
open protected fun verifyData(data: T) {
// By default we accept anything
}
}
}

View File

@ -1,4 +1,4 @@
package com.r3corda.core.crypto
package net.corda.core.crypto
import sun.security.util.HostnameChecker
import java.net.InetAddress
@ -62,7 +62,7 @@ object WhitelistTrustManagerProvider : Provider("WhitelistTrustManager",
Security.addProvider(WhitelistTrustManagerProvider)
// Register our custom TrustManagerFactorySpi
put("TrustManagerFactory.whitelistTrustManager", "com.r3corda.core.crypto.WhitelistTrustManagerSpi")
put("TrustManagerFactory.whitelistTrustManager", "net.corda.core.crypto.WhitelistTrustManagerSpi")
}
/**

View File

@ -1,9 +1,9 @@
package com.r3corda.core.crypto
package net.corda.core.crypto
import com.r3corda.core.exists
import com.r3corda.core.random63BitValue
import com.r3corda.core.read
import com.r3corda.core.write
import net.corda.core.exists
import net.corda.core.random63BitValue
import net.corda.core.read
import net.corda.core.write
import org.bouncycastle.asn1.ASN1Encodable
import org.bouncycastle.asn1.ASN1EncodableVector
import org.bouncycastle.asn1.DERSequence
@ -472,12 +472,12 @@ object X509Utilities {
*/
fun loadOrCreateKeyPairFromKeyStore(keyStoreFilePath: Path, storePassword: String, keyPassword: String,
alias: String, keyGenerator: () -> CACertAndKey): KeyPair {
val keyStore = X509Utilities.loadKeyStore(keyStoreFilePath, storePassword)
val keyStore = loadKeyStore(keyStoreFilePath, storePassword)
if (!keyStore.containsAlias(alias)) {
val selfSignCert = keyGenerator()
// Save to the key store.
keyStore.addOrReplaceKey(alias, selfSignCert.keyPair.private, keyPassword.toCharArray(), arrayOf(selfSignCert.certificate))
X509Utilities.saveKeyStore(keyStore, keyStoreFilePath, storePassword)
saveKeyStore(keyStore, keyStoreFilePath, storePassword)
}
val certificate = keyStore.getCertificate(alias)
@ -518,8 +518,8 @@ object X509Utilities {
trustStoreFilePath: Path,
trustStorePassword: String
): KeyStore {
val rootCA = X509Utilities.createSelfSignedCACert("Corda Node Root CA")
val intermediateCA = X509Utilities.createIntermediateCert("Corda Node Intermediate CA", rootCA)
val rootCA = createSelfSignedCACert("Corda Node Root CA")
val intermediateCA = createIntermediateCert("Corda Node Intermediate CA", rootCA)
val keyPass = keyPassword.toCharArray()
val keyStore = loadOrCreateKeyStore(keyStoreFilePath, storePassword)
@ -575,17 +575,17 @@ object X509Utilities {
keyPassword: String,
caKeyStore: KeyStore,
caKeyPassword: String): KeyStore {
val rootCA = X509Utilities.loadCertificateAndKey(caKeyStore,
val rootCA = loadCertificateAndKey(caKeyStore,
caKeyPassword,
X509Utilities.CORDA_ROOT_CA_PRIVATE_KEY)
val intermediateCA = X509Utilities.loadCertificateAndKey(caKeyStore,
CORDA_ROOT_CA_PRIVATE_KEY)
val intermediateCA = loadCertificateAndKey(caKeyStore,
caKeyPassword,
X509Utilities.CORDA_INTERMEDIATE_CA_PRIVATE_KEY)
CORDA_INTERMEDIATE_CA_PRIVATE_KEY)
val serverKey = X509Utilities.generateECDSAKeyPairForSSL()
val serverKey = generateECDSAKeyPairForSSL()
val host = InetAddress.getLocalHost()
val subject = getDevX509Name(host.canonicalHostName)
val serverCert = X509Utilities.createServerCert(subject,
val serverCert = createServerCert(subject,
serverKey.public,
intermediateCA,
if (host.canonicalHostName == host.hostName) listOf() else listOf(host.hostName),

View File

@ -1,20 +1,20 @@
package com.r3corda.protocols
package net.corda.protocols
import co.paralleluniverse.fibers.Suspendable
import com.r3corda.core.contracts.ContractState
import com.r3corda.core.contracts.StateAndRef
import com.r3corda.core.contracts.StateRef
import com.r3corda.core.crypto.DigitalSignature
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.signWithECDSA
import com.r3corda.core.node.recordTransactions
import com.r3corda.core.protocols.ProtocolLogic
import com.r3corda.core.transactions.SignedTransaction
import com.r3corda.core.transactions.WireTransaction
import com.r3corda.core.utilities.ProgressTracker
import com.r3corda.core.utilities.UntrustworthyData
import com.r3corda.protocols.AbstractStateReplacementProtocol.Acceptor
import com.r3corda.protocols.AbstractStateReplacementProtocol.Instigator
import net.corda.core.contracts.ContractState
import net.corda.core.contracts.StateAndRef
import net.corda.core.contracts.StateRef
import net.corda.core.crypto.DigitalSignature
import net.corda.core.crypto.Party
import net.corda.core.crypto.signWithECDSA
import net.corda.core.node.recordTransactions
import net.corda.core.protocols.ProtocolLogic
import net.corda.core.transactions.SignedTransaction
import net.corda.core.transactions.WireTransaction
import net.corda.core.utilities.ProgressTracker
import net.corda.core.utilities.UntrustworthyData
import net.corda.protocols.AbstractStateReplacementProtocol.Acceptor
import net.corda.protocols.AbstractStateReplacementProtocol.Instigator
import java.security.PublicKey
/**

View File

@ -1,11 +1,11 @@
package com.r3corda.protocols
package net.corda.protocols
import co.paralleluniverse.fibers.Suspendable
import com.r3corda.core.contracts.ClientToServiceCommand
import com.r3corda.core.crypto.Party
import com.r3corda.core.node.recordTransactions
import com.r3corda.core.protocols.ProtocolLogic
import com.r3corda.core.transactions.SignedTransaction
import net.corda.core.contracts.ClientToServiceCommand
import net.corda.core.crypto.Party
import net.corda.core.node.recordTransactions
import net.corda.core.protocols.ProtocolLogic
import net.corda.core.transactions.SignedTransaction
/**

View File

@ -1,9 +1,9 @@
package com.r3corda.protocols
package net.corda.protocols
import com.r3corda.core.contracts.Attachment
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.crypto.sha256
import net.corda.core.contracts.Attachment
import net.corda.core.crypto.Party
import net.corda.core.crypto.SecureHash
import net.corda.core.crypto.sha256
import java.io.ByteArrayInputStream
import java.io.InputStream
@ -30,4 +30,4 @@ class FetchAttachmentsProtocol(requests: Set<SecureHash>,
serviceHub.storageService.attachments.importAttachment(attachment.open())
}
}
}
}

View File

@ -1,13 +1,13 @@
package com.r3corda.protocols
package net.corda.protocols
import co.paralleluniverse.fibers.Suspendable
import com.r3corda.core.contracts.NamedByHash
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.protocols.ProtocolLogic
import com.r3corda.core.utilities.UntrustworthyData
import com.r3corda.protocols.FetchDataProtocol.DownloadedVsRequestedDataMismatch
import com.r3corda.protocols.FetchDataProtocol.HashNotFound
import net.corda.core.contracts.NamedByHash
import net.corda.core.crypto.Party
import net.corda.core.crypto.SecureHash
import net.corda.core.protocols.ProtocolLogic
import net.corda.core.utilities.UntrustworthyData
import net.corda.protocols.FetchDataProtocol.DownloadedVsRequestedDataMismatch
import net.corda.protocols.FetchDataProtocol.HashNotFound
import java.util.*
/**
@ -96,4 +96,4 @@ abstract class FetchDataProtocol<T : NamedByHash, in W : Any>(
answers
}
}
}

View File

@ -1,8 +1,8 @@
package com.r3corda.protocols
package net.corda.protocols
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.transactions.SignedTransaction
import net.corda.core.crypto.Party
import net.corda.core.crypto.SecureHash
import net.corda.core.transactions.SignedTransaction
/**
* Given a set of tx hashes (IDs), either loads them from local disk or asks the remote peer to provide them.
@ -16,4 +16,4 @@ class FetchTransactionsProtocol(requests: Set<SecureHash>, otherSide: Party) :
FetchDataProtocol<SignedTransaction, SignedTransaction>(requests, otherSide) {
override fun load(txid: SecureHash): SignedTransaction? = serviceHub.storageService.validatedTransactions.getTransaction(txid)
}
}

View File

@ -1,11 +1,11 @@
package com.r3corda.protocols
package net.corda.protocols
import co.paralleluniverse.fibers.Suspendable
import com.r3corda.core.contracts.ClientToServiceCommand
import com.r3corda.core.crypto.Party
import com.r3corda.core.protocols.ProtocolLogic
import com.r3corda.core.transactions.SignedTransaction
import com.r3corda.core.utilities.ProgressTracker
import net.corda.core.contracts.ClientToServiceCommand
import net.corda.core.crypto.Party
import net.corda.core.protocols.ProtocolLogic
import net.corda.core.transactions.SignedTransaction
import net.corda.core.utilities.ProgressTracker
/**

View File

@ -1,16 +1,16 @@
package com.r3corda.protocols
package net.corda.protocols
import co.paralleluniverse.fibers.Suspendable
import com.r3corda.core.contracts.ContractState
import com.r3corda.core.contracts.StateAndRef
import com.r3corda.core.contracts.StateRef
import com.r3corda.core.contracts.TransactionType
import com.r3corda.core.crypto.Party
import com.r3corda.core.transactions.SignedTransaction
import com.r3corda.core.utilities.ProgressTracker
import com.r3corda.core.utilities.UntrustworthyData
import com.r3corda.protocols.NotaryChangeProtocol.Acceptor
import com.r3corda.protocols.NotaryChangeProtocol.Instigator
import net.corda.core.contracts.ContractState
import net.corda.core.contracts.StateAndRef
import net.corda.core.contracts.StateRef
import net.corda.core.contracts.TransactionType
import net.corda.core.crypto.Party
import net.corda.core.transactions.SignedTransaction
import net.corda.core.utilities.ProgressTracker
import net.corda.core.utilities.UntrustworthyData
import net.corda.protocols.NotaryChangeProtocol.Acceptor
import net.corda.protocols.NotaryChangeProtocol.Instigator
import java.security.PublicKey
/**
@ -82,4 +82,4 @@ object NotaryChangeProtocol: AbstractStateReplacementProtocol<Party>() {
}
}
}
}
}

View File

@ -1,20 +1,20 @@
package com.r3corda.protocols
package net.corda.protocols
import co.paralleluniverse.fibers.Suspendable
import com.r3corda.core.crypto.DigitalSignature
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.SignedData
import com.r3corda.core.crypto.signWithECDSA
import com.r3corda.core.node.services.TimestampChecker
import com.r3corda.core.node.services.UniquenessException
import com.r3corda.core.node.services.UniquenessProvider
import com.r3corda.core.protocols.ProtocolLogic
import com.r3corda.core.serialization.SerializedBytes
import com.r3corda.core.serialization.serialize
import com.r3corda.core.transactions.SignedTransaction
import com.r3corda.core.transactions.WireTransaction
import com.r3corda.core.utilities.ProgressTracker
import com.r3corda.core.utilities.UntrustworthyData
import net.corda.core.crypto.DigitalSignature
import net.corda.core.crypto.Party
import net.corda.core.crypto.SignedData
import net.corda.core.crypto.signWithECDSA
import net.corda.core.node.services.TimestampChecker
import net.corda.core.node.services.UniquenessException
import net.corda.core.node.services.UniquenessProvider
import net.corda.core.protocols.ProtocolLogic
import net.corda.core.serialization.SerializedBytes
import net.corda.core.serialization.serialize
import net.corda.core.transactions.SignedTransaction
import net.corda.core.transactions.WireTransaction
import net.corda.core.utilities.ProgressTracker
import net.corda.core.utilities.UntrustworthyData
import java.security.PublicKey
object NotaryProtocol {

View File

@ -1,14 +1,14 @@
package com.r3corda.protocols
package net.corda.protocols
import co.paralleluniverse.fibers.Suspendable
import com.r3corda.core.checkedAdd
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.node.recordTransactions
import com.r3corda.core.protocols.ProtocolLogic
import com.r3corda.core.transactions.LedgerTransaction
import com.r3corda.core.transactions.SignedTransaction
import com.r3corda.core.transactions.WireTransaction
import net.corda.core.checkedAdd
import net.corda.core.crypto.Party
import net.corda.core.crypto.SecureHash
import net.corda.core.node.recordTransactions
import net.corda.core.protocols.ProtocolLogic
import net.corda.core.transactions.LedgerTransaction
import net.corda.core.transactions.SignedTransaction
import net.corda.core.transactions.WireTransaction
import java.util.*
// TODO: This code is currently unit tested by TwoPartyTradeProtocolTests, it should have its own tests.

View File

@ -1,11 +1,11 @@
package com.r3corda.protocols
package net.corda.protocols
import com.google.common.util.concurrent.ListenableFuture
import com.r3corda.core.messaging.MessagingService
import com.r3corda.core.messaging.SingleMessageRecipient
import com.r3corda.core.messaging.onNext
import com.r3corda.core.messaging.send
import com.r3corda.core.node.services.DEFAULT_SESSION_ID
import net.corda.core.messaging.MessagingService
import net.corda.core.messaging.SingleMessageRecipient
import net.corda.core.messaging.onNext
import net.corda.core.messaging.send
import net.corda.core.node.services.DEFAULT_SESSION_ID
/**
* Abstract superclass for request messages sent to services which expect a reply.
@ -25,4 +25,4 @@ fun <R : Any> MessagingService.sendRequest(topic: String,
val responseFuture = onNext<R>(topic, request.sessionID)
send(topic, DEFAULT_SESSION_ID, request, target)
return responseFuture
}
}

View File

@ -1,22 +1,22 @@
package com.r3corda.protocols
package net.corda.protocols
import co.paralleluniverse.fibers.Suspendable
import com.r3corda.core.TransientProperty
import com.r3corda.core.contracts.*
import com.r3corda.core.crypto.DigitalSignature
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.signWithECDSA
import com.r3corda.core.node.NodeInfo
import com.r3corda.core.node.recordTransactions
import com.r3corda.core.node.services.ServiceType
import com.r3corda.core.protocols.ProtocolLogic
import com.r3corda.core.seconds
import com.r3corda.core.transactions.SignedTransaction
import com.r3corda.core.transactions.TransactionBuilder
import com.r3corda.core.transactions.WireTransaction
import com.r3corda.core.utilities.ProgressTracker
import com.r3corda.core.utilities.UntrustworthyData
import com.r3corda.core.utilities.trace
import net.corda.core.TransientProperty
import net.corda.core.contracts.*
import net.corda.core.crypto.DigitalSignature
import net.corda.core.crypto.Party
import net.corda.core.crypto.signWithECDSA
import net.corda.core.node.NodeInfo
import net.corda.core.node.recordTransactions
import net.corda.core.node.services.ServiceType
import net.corda.core.protocols.ProtocolLogic
import net.corda.core.seconds
import net.corda.core.transactions.SignedTransaction
import net.corda.core.transactions.TransactionBuilder
import net.corda.core.transactions.WireTransaction
import net.corda.core.utilities.ProgressTracker
import net.corda.core.utilities.UntrustworthyData
import net.corda.core.utilities.trace
import java.math.BigDecimal
import java.security.KeyPair
import java.security.PublicKey

View File

@ -1,12 +1,12 @@
package com.r3corda.protocols
package net.corda.protocols
import co.paralleluniverse.fibers.Suspendable
import com.r3corda.core.contracts.TransactionVerificationException
import com.r3corda.core.crypto.Party
import com.r3corda.core.node.services.TimestampChecker
import com.r3corda.core.node.services.UniquenessProvider
import com.r3corda.core.transactions.SignedTransaction
import com.r3corda.core.transactions.WireTransaction
import net.corda.core.contracts.TransactionVerificationException
import net.corda.core.crypto.Party
import net.corda.core.node.services.TimestampChecker
import net.corda.core.node.services.UniquenessProvider
import net.corda.core.transactions.SignedTransaction
import net.corda.core.transactions.WireTransaction
import java.security.SignatureException
/**
@ -48,4 +48,4 @@ class ValidatingNotaryProtocol(otherSide: Party,
private fun resolveTransaction(reqIdentity: Party, wtx: WireTransaction) {
subProtocol(ResolveTransactionsProtocol(wtx, reqIdentity))
}
}
}

View File

@ -1,4 +1,4 @@
package com.r3corda.core.protocols;
package net.corda.core.protocols;
import org.junit.Test;

View File

@ -1,6 +1,6 @@
package com.r3corda.core
package net.corda.core
import com.r3corda.core.contracts.*
import net.corda.core.contracts.*
import org.junit.Test
import java.time.LocalDate
import java.util.*
@ -180,4 +180,4 @@ class FinanceTypesTest {
assertEquals(ids[1], ids[2])
assertEquals(ids[1].hashCode(), ids[2].hashCode())
}
}
}

View File

@ -1,10 +1,10 @@
package com.r3corda.core.contracts
package net.corda.core.contracts
import com.r3corda.contracts.asset.Cash
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.utilities.DUMMY_PUBKEY_1
import com.r3corda.core.utilities.DUMMY_PUBKEY_2
import com.r3corda.testing.*
import net.corda.contracts.asset.Cash
import net.corda.core.crypto.SecureHash
import net.corda.core.utilities.DUMMY_PUBKEY_1
import net.corda.core.utilities.DUMMY_PUBKEY_2
import net.corda.testing.*
import org.junit.Test
import java.security.PublicKey
import java.time.Instant
@ -154,4 +154,4 @@ class TransactionEncumbranceTests {
}
}
}
}
}

View File

@ -1,12 +1,12 @@
package com.r3corda.core.contracts
package net.corda.core.contracts
import com.r3corda.core.crypto.newSecureRandom
import com.r3corda.core.transactions.SignedTransaction
import com.r3corda.core.transactions.WireTransaction
import com.r3corda.core.utilities.DUMMY_NOTARY
import com.r3corda.core.utilities.DUMMY_NOTARY_KEY
import com.r3corda.testing.node.MockTransactionStorage
import com.r3corda.testing.MEGA_CORP_KEY
import net.corda.core.crypto.newSecureRandom
import net.corda.core.transactions.SignedTransaction
import net.corda.core.transactions.WireTransaction
import net.corda.core.utilities.DUMMY_NOTARY
import net.corda.core.utilities.DUMMY_NOTARY_KEY
import net.corda.testing.node.MockTransactionStorage
import net.corda.testing.MEGA_CORP_KEY
import org.junit.Test
import java.security.KeyPair
import kotlin.test.assertEquals

View File

@ -1,20 +1,20 @@
package com.r3corda.core.contracts
package net.corda.core.contracts
import com.r3corda.contracts.asset.DUMMY_CASH_ISSUER_KEY
import com.r3corda.core.crypto.Party
import com.r3corda.core.crypto.SecureHash
import com.r3corda.core.crypto.signWithECDSA
import com.r3corda.core.serialization.SerializedBytes
import com.r3corda.core.transactions.LedgerTransaction
import com.r3corda.core.transactions.SignedTransaction
import com.r3corda.core.transactions.WireTransaction
import com.r3corda.core.utilities.DUMMY_KEY_1
import com.r3corda.core.utilities.DUMMY_KEY_2
import com.r3corda.core.utilities.DUMMY_NOTARY
import com.r3corda.core.utilities.DUMMY_NOTARY_KEY
import com.r3corda.testing.ALICE
import com.r3corda.testing.ALICE_PUBKEY
import com.r3corda.testing.BOB
import net.corda.contracts.asset.DUMMY_CASH_ISSUER_KEY
import net.corda.core.crypto.Party
import net.corda.core.crypto.SecureHash
import net.corda.core.crypto.signWithECDSA
import net.corda.core.serialization.SerializedBytes
import net.corda.core.transactions.LedgerTransaction
import net.corda.core.transactions.SignedTransaction
import net.corda.core.transactions.WireTransaction
import net.corda.core.utilities.DUMMY_KEY_1
import net.corda.core.utilities.DUMMY_KEY_2
import net.corda.core.utilities.DUMMY_NOTARY
import net.corda.core.utilities.DUMMY_NOTARY_KEY
import net.corda.testing.ALICE
import net.corda.testing.ALICE_PUBKEY
import net.corda.testing.BOB
import org.junit.Test
import java.security.KeyPair
import kotlin.test.assertEquals

View File

@ -1,9 +1,9 @@
package com.r3corda.core.contracts.clauses
package net.corda.core.contracts.clauses
import com.r3corda.core.contracts.AuthenticatedObject
import com.r3corda.core.contracts.CommandData
import com.r3corda.core.contracts.TransactionForContract
import com.r3corda.core.crypto.SecureHash
import net.corda.core.contracts.AuthenticatedObject
import net.corda.core.contracts.CommandData
import net.corda.core.contracts.TransactionForContract
import net.corda.core.crypto.SecureHash
import org.junit.Test
import java.util.concurrent.atomic.AtomicInteger
import kotlin.test.assertEquals
@ -28,4 +28,4 @@ class AllCompositionTests {
val tx = TransactionForContract(emptyList(), emptyList(), emptyList(), emptyList(), SecureHash.randomSHA256())
assertFailsWith<IllegalStateException> { verifyClause(tx, clause, emptyList<AuthenticatedObject<CommandData>>()) }
}
}
}

View File

@ -1,10 +1,10 @@
package com.r3corda.core.contracts.clauses
package net.corda.core.contracts.clauses
import com.r3corda.core.contracts.AuthenticatedObject
import com.r3corda.core.contracts.CommandData
import com.r3corda.core.contracts.ContractState
import com.r3corda.core.contracts.TransactionForContract
import com.r3corda.core.crypto.SecureHash
import net.corda.core.contracts.AuthenticatedObject
import net.corda.core.contracts.CommandData
import net.corda.core.contracts.ContractState
import net.corda.core.contracts.TransactionForContract
import net.corda.core.crypto.SecureHash
import org.junit.Test
import java.util.concurrent.atomic.AtomicInteger
import kotlin.test.assertEquals
@ -43,4 +43,4 @@ class AnyCompositionTests {
// Check that we've run the verify() function of neither clause
assertEquals(0, counter.get())
}
}
}

View File

@ -1,9 +1,9 @@
package com.r3corda.core.contracts.clauses
package net.corda.core.contracts.clauses
import com.r3corda.core.contracts.AuthenticatedObject
import com.r3corda.core.contracts.CommandData
import com.r3corda.core.contracts.ContractState
import com.r3corda.core.contracts.TransactionForContract
import net.corda.core.contracts.AuthenticatedObject
import net.corda.core.contracts.CommandData
import net.corda.core.contracts.ContractState
import net.corda.core.contracts.TransactionForContract
import java.util.concurrent.atomic.AtomicInteger
internal fun matchedClause(counter: AtomicInteger? = null) = object : Clause<ContractState, CommandData, Unit>() {
@ -26,4 +26,4 @@ internal fun unmatchedClause(counter: AtomicInteger? = null) = object : Clause<C
counter?.incrementAndGet()
return emptySet()
}
}
}

View File

@ -1,7 +1,7 @@
package com.r3corda.core.contracts.clauses
package net.corda.core.contracts.clauses
import com.r3corda.core.contracts.*
import com.r3corda.core.crypto.SecureHash
import net.corda.core.contracts.*
import net.corda.core.crypto.SecureHash
import org.junit.Test
import kotlin.test.assertFailsWith
@ -35,4 +35,4 @@ class VerifyClausesTests {
// The clause is matched, but doesn't mark the command as consumed, so this should error
assertFailsWith<IllegalStateException> { verifyClause(tx, clause, listOf(command)) }
}
}
}

View File

@ -1,4 +1,4 @@
package com.r3corda.core.crypto
package net.corda.core.crypto
import org.junit.Test
import java.math.BigInteger

View File

@ -1,13 +1,13 @@
package com.r3corda.core.crypto
package net.corda.core.crypto
import com.esotericsoftware.kryo.serializers.MapSerializer
import com.r3corda.contracts.asset.*
import com.r3corda.core.contracts.DOLLARS
import com.r3corda.core.contracts.`issued by`
import com.r3corda.core.serialization.*
import com.r3corda.core.transactions.*
import com.r3corda.core.utilities.DUMMY_PUBKEY_1
import com.r3corda.testing.*
import net.corda.contracts.asset.*
import net.corda.core.contracts.DOLLARS
import net.corda.core.contracts.`issued by`
import net.corda.core.serialization.*
import net.corda.core.transactions.*
import net.corda.core.utilities.DUMMY_PUBKEY_1
import net.corda.testing.*
import org.junit.Test
@ -20,7 +20,7 @@ import kotlin.test.assertTrue
class PartialMerkleTreeTest {
val nodes = "abcdef"
val hashed = nodes.map { it.serialize().sha256() }
val root = SecureHash.Companion.parse("F6D8FB3720114F8D040D64F633B0D9178EB09A55AA7D62FAE1A070D1BF561051")
val root = SecureHash.parse("F6D8FB3720114F8D040D64F633B0D9178EB09A55AA7D62FAE1A070D1BF561051")
val merkleTree = MerkleTree.getMerkleTree(hashed)
val testLedger = ledger {
@ -51,7 +51,7 @@ class PartialMerkleTreeTest {
@Test
fun `building Merkle tree - no hashes`() {
assertFailsWith<MerkleTreeException> { MerkleTree.getMerkleTree(emptyList()) }
assertFailsWith<MerkleTreeException> { MerkleTree.Companion.getMerkleTree(emptyList()) }
}
@Test

View File

@ -1,6 +1,6 @@
package com.r3corda.core.crypto
package net.corda.core.crypto
import com.r3corda.core.serialization.OpaqueBytes
import net.corda.core.serialization.OpaqueBytes
import org.junit.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue
@ -58,4 +58,4 @@ class PublicKeyTreeTests {
assertEquals(decoded, aliceAndBobOrCharlie)
}
}
}

View File

@ -1,6 +1,6 @@
package com.r3corda.core.crypto
package net.corda.core.crypto
import com.r3corda.core.serialization.serialize
import net.corda.core.serialization.serialize
import org.junit.Test
import java.security.SignatureException
import kotlin.test.assertEquals
@ -27,4 +27,4 @@ class SignedDataTest {
val wrappedData = SignedData(serialized, sig)
wrappedData.verified()
}
}
}

View File

@ -1,4 +1,4 @@
package com.r3corda.core.crypto
package net.corda.core.crypto
import org.junit.BeforeClass
import org.junit.Test
@ -173,33 +173,33 @@ class WhitelistTrustManagerTest {
fun `check unknown certificate rejected against mismatched wildcard`() {
val (trustManager, cert) = getTrustmanagerAndCert("*.r3corda.com", "test.notr3.com")
assertFailsWith<java.security.cert.CertificateException> { trustManager.checkServerTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM) }
assertFailsWith<CertificateException> { trustManager.checkServerTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM) }
assertFailsWith<java.security.cert.CertificateException> { trustManager.checkServerTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM, null as Socket?) }
assertFailsWith<CertificateException> { trustManager.checkServerTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM, null as Socket?) }
assertFailsWith<java.security.cert.CertificateException> { trustManager.checkServerTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM, null as SSLEngine?) }
assertFailsWith<CertificateException> { trustManager.checkServerTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM, null as SSLEngine?) }
assertFailsWith<java.security.cert.CertificateException> { trustManager.checkClientTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM) }
assertFailsWith<CertificateException> { trustManager.checkClientTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM) }
assertFailsWith<java.security.cert.CertificateException> { trustManager.checkClientTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM, null as Socket?) }
assertFailsWith<CertificateException> { trustManager.checkClientTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM, null as Socket?) }
assertFailsWith<java.security.cert.CertificateException> { trustManager.checkClientTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM, null as SSLEngine?) }
assertFailsWith<CertificateException> { trustManager.checkClientTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM, null as SSLEngine?) }
}
@Test
fun `check certificate signed by untrusted root is still rejected, despite matched name`() {
val (trustManager, cert) = getTrustmanagerAndUntrustedChainCert()
assertFailsWith<java.security.cert.CertificateException> { trustManager.checkServerTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM) }
assertFailsWith<CertificateException> { trustManager.checkServerTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM) }
assertFailsWith<java.security.cert.CertificateException> { trustManager.checkServerTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM, null as Socket?) }
assertFailsWith<CertificateException> { trustManager.checkServerTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM, null as Socket?) }
assertFailsWith<java.security.cert.CertificateException> { trustManager.checkServerTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM, null as SSLEngine?) }
assertFailsWith<CertificateException> { trustManager.checkServerTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM, null as SSLEngine?) }
assertFailsWith<java.security.cert.CertificateException> { trustManager.checkClientTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM) }
assertFailsWith<CertificateException> { trustManager.checkClientTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM) }
assertFailsWith<java.security.cert.CertificateException> { trustManager.checkClientTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM, null as Socket?) }
assertFailsWith<CertificateException> { trustManager.checkClientTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM, null as Socket?) }
assertFailsWith<java.security.cert.CertificateException> { trustManager.checkClientTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM, null as SSLEngine?) }
assertFailsWith<CertificateException> { trustManager.checkClientTrusted(arrayOf(cert), X509Utilities.SIGNATURE_ALGORITHM, null as SSLEngine?) }
}
}
}

Some files were not shown because too many files have changed in this diff Show More