授时存证业务接口

授时存证智能合约模块扩展自存证智能合约模块,一样由授时存证代理合约、授时存证合约、授时存证记录合约等多个合约组成。区别仅在于授时存证记录合约中增加了时间戳和时间戳证书字段。

因此,存证业务接口中的5个黑白名单相关接口和检查写入存证记录权限接口,对于授时存证智能合约是一样适用的,以下仅描述授时存证业务中不同的接口:产生待签原文(请求授时)、写入授时存证记录、更新授时存证记录、获取授时存证记录合约信息。

产生待签原文(请求授时)

接口说明:产生待签原文并请求授时,在返回结果中接收时间戳。该接口与普通的“产生待签原文”接口对比,只是请求地址和返回结果不一样,请求参数完全相同。

请求方式:POST

请求地址:http://BROP_HOST:PORT/common/buildSendInfoByNTSC.json

队列事件:无

参数列表:

名称 类型 描述
contractAddress String 合约地址
bizId String 业务ID
blockLimit Integer 超时块号
method String 智能合约方法
params String[](Object...) 智能合约方法参数

返回结果:

名称 类型 描述
rawText String 待签原文
ntscTime String 时间戳,发送交易的ntscTime值
ntscSignature String 时间戳签名,用于验证时间戳有效性,发送交易的ntscSignature值

请求示例:

{
  "blockLimit": 594283,
  "method": "createRecord",
  "bizId": "424774206589462",
  "contractAddress": "c2d100f42e4ed3d9cea639ce3db9211cfe3f3824",
  "params": [
    "61887b928c43e9d8bf324c189a60fa06359a3741",
    "424774206601781",
    "",
    " f2f9184ae540fb779a671dd2dce0e562d919fa28f3b66e25d68ca4fc14b0945b ",
    "{\"fileAddr\":\"[https://www.business.com/file/201700058.pdf\",\"algorithm\":\"SHA256\"}](https://www.business.com/file/201700058.pdf\",\"algorithm\":\"SHA256\"})",
    "45865da5c7013d0e5b5074fc98850ed2c8a725f1"
  ]
}

返回示例:

{
  "code": "SUCCESS",
  "detail": {
    "rawText": "06b73778a8e436d5f2718dc0ca08e0e29737ebc317d32605baec662bbb6622b5",
    "ntscTime": "1525672628000",
    "ntscSignature": "MIIExDADAgEAMIIEuwYKKoEcz1UGAQQCAqCCBKswggSnAgEDMQ4wDAYIKoEcz1UBg3UFADCB4wYLKoZIhvcNAQkQAQS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VBAgeBmxfgs93ATEPMA0GA1UEBx4GU1dOrF4CMREwDwYDVQQKHghsX4LPXn91NTEPMA0GA1UECx4GeBRT0ZDoMQ8wDQYDVQQDEwZob3N0c20CDQDRBXBWh3nBNPljTLgwDAYIKoEcz1UBg3UFAKCBmDAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwHAYJKoZIhvcNAQkFMQ8XDTE4MDUwNzA1NTcwOFowKwYLKoZIhvcNAQkQAgwxHDAaMBgwFgQUO0MZOugNRehbYMXIMpo4uFLt3TUwLwYJKoZIhvcNAQkEMSIEIINwyxYjE+f543XGjgaGGNcHtDukgYZXHxTEwfRRSlRyMA0GCSqBHM9VAYItAQUABEYwRAIgEmme0ZUCW8pQiAEOvrd6tFERUXIZx5UGSmD9pMX9jPECICgCKnNmubMt6krmtugqLyfuRiwuCI4lAh9d9Mwd5b43"
  }
}

写入授时存证记录

接口说明:拥有当前授时存证合约的写入存证记录权限的身份合约账户可以调用。

调用类型:交易方法

请求方式:POST

请求地址:http://BROP_HOST:PORT/common/sendTx.json

队列事件:EVENT_TX_RECORDED、EVENT_CONTRACT_CREATE

参数列表:

名称 类型 描述
contractAddress String 授时存证代理合约的合约地址
bizId String 调用方维护的唯一业务请求ID
blockLimit Integer 确认上链最大块号
method String createRecord
signatureInBase64 String 已签名数据
params[0] String 写入授时存证记录的存证合约的合约地址
params[1] String 存证流水号,不能为空,最长48字节
params[2] String 前序存证流水号,可为空,最长48字节
params[3] String 存证信息,最长128字节。需要存证的业务数据经过计算摘要得到,推荐使用SHA-256算法
params[4] String 自定义信息,最长800字节,可选
params[5] String 交易发起方身份合约地址
params[6] String 授时时间戳,小于等于30字节,调用产生待签原文(请求授时) 的返回值nstcTime
params[7] String 授时时间戳签名,小于等于2000,调用产生待签原文(请求授时) 的返回值nstcSignature

接口返回:

名称 类型 描述
detail String txHash(存证号)

请求示例:

{
  "blockLimit": 602575,
  "method": "createRecord",
  "bizId": "63875289412358",
  "contractAddress": "4883fbf28d8d5d2463c234e6b87bf94d550643a2",
  "signatureInBase64": "HFvtonyNtIBFAaVvdh4WpgBZvbfphvhkzLQoYLdlQsO76Iq6jquvxhccm5YC9TaFgKxPGQWPfaFNU+HNzWZprYs=",
  "params": [
    "1a94d3c7b8d75e1d1e50a374803ee0934edeac25",
    "1234567890123",
    "",
    " f2f9184ae540fb779a671dd2dce0e562d919fa28f3b66e25d68ca4fc14b0945b ",
    "{\"fileAddr\":\"home/file/123456.txt\",\"algorithm\":\"SHA256\"}",
    "7f6e1fb804bdfa7f45f7e4f45bf197ab0a809986",
    "1525672628000",
    "MIIExDADAgEAMIIEuwYKKoEcz1UGAQQCAqCCBKswggSnAgEDMQ4wDAYIKoEcz1UBg3UFADCB4wYLKoZIhvcNAQkQAQSggdMEgdAwgc0CAQEGBCoDBAEwMTANBglghkgBZQMEAgEFAAQg47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFUCCQC1Igfw/zmLLRgPMjAxODA1MDcwNTU3MDhaAgkA4AJ63Yl7KfOgaKRmMGQxCzAJBgNVBAYTAkNOMQ8wDQYDVQQIHgZsX4LPdwExDzANBgNVBAceBlNXTqxeAjERMA8GA1UECh4IbF+Cz15/dTUxDzANBgNVBAseBngUU9GQ6DEPMA0GA1UEAxMGaG9zdHNtoIICKDCCAiQwggHKoAMCAQICDQDRBXBWh3nBNPljTLgwCgYIKoEcz1UBg3UwZDELMAkGA1UEBhMCQ04xDzANBgNVBAgeBmxfgs93ATEPMA0GA1UEBx4GU1dOrF4CMREwDwYDVQQKHghsX4LPXn91NTEPMA0GA1UECx4GeBRT0ZDoMQ8wDQYDVQQDEwZob3N0c20wIhgPMjAxODA1MDExNjAwMDBaGA8yMDI4MDQyODE2MDAwMFowZDELMAkGA1UEBhMCQ04xDzANBgNVBAgeBmxfgs93ATEPMA0GA1UEBx4GU1dOrF4CMREwDwYDVQQKHghsX4LPXn91NTEPMA0GA1UECx4GeBRT0ZDoMQ8wDQYDVQQDEwZob3N0c20wWTATBgcqhkjOPQIBBggqgRzPVQGCLQNCAAQcD98W5PosZ9/wKBZ9bs0ptmHGmJINGFCKx6e21Q4tuh9zKaTK8jK3xhBUn3fuNjXRJdoDig9KtiUvtTx1Ic+Do10wWzAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBTC63xhEIVsWb/bTh97bvPGbK5LEjAfBgNVHSMEGDAWgBTC63xhEIVsWb/bTh97bvPGbK5LEjALBgNVHQ8EBAMCAYYwCgYIKoEcz1UBg3UDSAAwRQIgFh0UKPEps5RtcfXMGLHUGj0OHnvmrAa3mU1+KgJ4EcwCIQCL6XJD1P9f1CrjKtdYx99LIRGr/fE3Roskz2sqnJgqNzGCAX4wggF6AgEBMHUwZDELMAkGA1UEBhMCQ04xDzANBgNVBAgeBmxfgs93ATEPMA0GA1UEBx4GU1dOrF4CMREwDwYDVQQKHghsX4LPXn91NTEPMA0GA1UECx4GeBRT0ZDoMQ8wDQYDVQQDEwZob3N0c20CDQDRBXBWh3nBNPljTLgwDAYIKoEcz1UBg3UFAKCBmDAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwHAYJKoZIhvcNAQkFMQ8XDTE4MDUwNzA1NTcwOFowKwYLKoZIhvcNAQkQAgwxHDAaMBgwFgQUO0MZOugNRehbYMXIMpo4uFLt3TUwLwYJKoZIhvcNAQkEMSIEIINwyxYjE+f543XGjgaGGNcHtDukgYZXHxTEwfRRSlRyMA0GCSqBHM9VAYItAQUABEYwRAIgEmme0ZUCW8pQiAEOvrd6tFERUXIZx5UGSmD9pMX9jPECICgCKnNmubMt6krmtugqLyfuRiwuCI4lAh9d9Mwd5b43"
  ]
}

返回示例:

{
  "code": "SUCCESS",
  "detail": "132e4da3866a2bb439720410a666f8cc22ae5fac780595be6b6faf83cd340100"
}

更新授时存证记录

接口说明:拥有当前授时存证合约的写入存证记录权限的身份合约用户可以调用。

调用类型:交易方法

请求方式:POST

请求地址:http://BROP_HOST:PORT/common/sendTx.json

队列事件:EVENT_TX_RECORDED、EVENT_CONTRACT_CREATE

参数列表:

名称 类型 描述
contractAddress String 授时存证代理合约的合约地址
bizId String 调用方维护的唯一业务请求ID
blockLimit Integer 确认上链最大块号
method String updateRecord
signatureInBase64 String 已签名数据
params[0] String 写入授时存证记录的存证合约的合约地址
params[1] String 存证流水号,不能为空,最长48字节
params[2] String 前序存证流水号,可为空,最长48字节
params[3] String 存证信息,最长128字节。需要存证的业务数据经过计算摘要得到,推荐使用SHA-256算法
params[4] String 自定义信息,最长800字节,可选
params[5] String 交易发起方身份合约地址
params[6] String 授时时间戳,小于等于30字节,调用产生待签原文(请求授时) 的返回值nstcTime
params[7] String 授时时间戳签名,小于等于2000,调用 产生待签原文(请求授时) 的 返回值nstcSignature

接口返回:

名称 类型 描述
detail String txHash(存证号)

请求示例:

{
  "blockLimit": 602643,
  "method": "updateRecord",
  "bizId": "423956783123546",
  "contractAddress": "4883fbf28d8d5d2463c234e6b87bf94d550643a2",
  "signatureInBase64": "GwbFUXq61zl/8U1XvpcdFYywJNS0Ctr5M8hMFp77uQonNvFGM+z664bReZNmt+jzAzr7Cl5/GupqjaoXuOD1YCQ=",
  "params": [
    "1a94d3c7b8d75e1d1e50a374803ee0934edeac25",
    "424774206601781",
    "",
    " f2f9184ae540fb779a671dd2dce0e562d919fa28f3b66e25d68ca4fc14b0945b ",
    "{\"fileAddr\":\"home/file/123456.txt\",\"algorithm\":\"SHA256\"}",
    "7f6e1fb804bdfa7f45f7e4f45bf197ab0a809986",
    "1527061997000",
    "MIIExTADAgEAMIIEvAYKKoEcz1UGAQQCAqCCBKwwggSoAgEDMQ4wDAYIKoEcz1UBg3UFADCB4wYLKoZIhvcNAQkQAQSggdMEgdAwgc0CAQEGBCoDBAEwMTANBglghkgBZQMEAgEFAAQg8uznTYb340w7vuXZVHeIp62Sk2u05zVckY1fYSkJU0sCCQDt5ZW5/YV5LhgPMjAxODA1MjMwNzUzMTdaAgkAn0dB72m3li+gaKRmMGQxCzAJBgNVBAYTAkN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xDQYLKoZIhvcNAQkQAQQwHAYJKoZIhvcNAQkFMQ8XDTE4MDUyMzA3NTMxN1owKwYLKoZIhvcNAQkQAgwxHDAaMBgwFgQUO0MZOugNRehbYMXIMpo4uFLt3TUwLwYJKoZIhvcNAQkEMSIEII9n6uWCInGyhGqopafDrqj+IwjVa/bnxK5j/WC52KJ8MA0GCSqBHM9VAYItAQUABEcwRQIgFHHG9NzhwJGZngYvO3MoWRr1KWBanAsmIRDn2BiD3ZwCIQDs9QUIX73yCIfR+saTewRozV/di6nA+ehLu6rjdQvVew=="
  ]
}

返回示例:

{
  "code": "SUCCESS",
  "detail": "2b78f7ab0da3d25639475a1b319d2ae7450a9fc1c9412cb2b38694b5ae27571c"
}

获取授时存证记录信息

接口说明:获取授时存证记录合约的信息。

调用类型:只读方法

请求方式:POST

请求地址:http://BROP_HOST:PORT/common/contract.json

队列事件:否

参数列表:

名称 类型 描述
contractAddress String 授时存证记录合约的合约地址
functionName String getData

接口返回:

名称 类型 描述
seqId String 存证流水号
preSeqId String 前序流水号
recordData String 存证信息
customString String 自定义字段
ntscTime String 授时时间戳
ntscSignature String 时间戳签名,用于验证有效性

请求示例:

{
  "functionName": "getData",
  "contractAddress": "a4f528f949c1ed39671da722d0324d6e82657bee",
  "params": []
}

返回示例:

{
  "code": "SUCCESS",
  "detail": {
    "preSeqId": "",
    "recordData": "1234565768",
    "seqId": "424774206601781",
    "customString": "asdf",
    "nstcTime": "1525672628000",
    "nstcSignature": "MIIExDADAgEAMIIEuwYKKoEcz1UGAQQCAqCCBKswggSnAgEDMQ4wDAYIKoEcz1UBg3UFADCB4wYLKoZIhvcNAQkQAQSggdMEgdAwgc0CAQEGBCoDBAEwMTANBglghkgBZQMEAgEFAAQg47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFUCCQC1Igfw/zmLLRgPMjAxODA1MDcwNTU3MDhaAgkA4AJ63Yl7KfOgaKRmMGQxCzAJBgNVBAYTAkNOMQ8wDQYDVQQIHg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