- Documentation
Torch Object Storage
Tool Guide
tosutil
Common commands
Share objects
Create an authorization code (share-crt)
Share objects
Create an authorization code (share-crt)
Create an authorization code (share-crt)
You can use the share-crt command to create authorization codes. These codes allow you to share objects with others.
Command syntax
./tosutil share-crt tos://bucket[/prefix] [-vp=xxx] [-dst=xxx] [-em] [-e=xxx] [-re=xxx] [-i=xxx] [-k=xxx] [-t=xxx] [-conf=xxx]
tosutil share-crt tos://bucket[/prefix] [-vp=xxx] [-dst=xxx] [-em] [-e=xxx] [-re=xxx] [-i=xxx] [-k=xxx] [-t=xxx] [-conf=xxx]
Parameters
Examples
Share all objects in a bucket
Use the following command to share all objects in the bucketname bucket. The authorization code is valid for one hour.
./tosutil share-crt tos://bucketname -vp 1h
https://document-share.tos-cn-beijing.volces.com/index.html?token=/****+aY3yfy+JmQ2Yd144VAZ5FuFbHru0ADVaY5wZkCUQMZYifSKe5n1IL2WqrqLb/bzYMKl2lqdIZPG8dBL4XEXeKE9SqtS4n+f17aaSIBU3B288ly9ANNBJ7eaBCni7/UKKpK49ZfXxm0mCdbS9sFTNahK5IAesDvAqMQis7wTxRrrqSRG2zGgabYgTNbRWD2OklttTJPtSA4940kisfHOEQwWBZol7MVarJItDqVEeiT80wLa3pr+5gb/8ZtWrBBfCOjAkEJY7AUmOSm5IMJsbhIzRhk9nV9ieDfSvJBGFaFg+vBjF7Xut2/pAEKozR2lKCoCKKZwI9BOJMnlCd15e9vlQfNeUVARqfhyTrVJJzX3wJfB/KTiA1MPQRtogaANfeHgOtPxu2gQzdPFX5kbRXAMmIEQHxZ/zOPR52AEWJSKLwDU/McV101wKuGIiQr90rs2izlMuEywF7g+cXftUmMvaMDQWehRpMRpxlI8kZMwVwJ/pbt3wi3/sNFgoSnnzvHxXY8dF/WsqVLUxOec3Qrd7l96bCY3Pd3yc742Mk7PO+VLOMIB//k****
Tue, 06 Dec 2022 10:45:50 GMT
Share a directory within a bucket
Use the following command to share objects in the file folder within the bucketname bucket.
./tosutil share-crt tos://bucketname/file/
https://document-share.tos-cn-beijing.volces.com/index.html?token=/****+aY3yfy+JmQ2Yd144VAZ5FuFbHru0ADVaY5wZkCUQMZYifSKe5n1IL2WqrqLb/bzYMKl2lqdIZPG8dBL4XEXeKE9SqtS4n+f17aaSIBU3B288ly9ANNBJ7eaBCni7/UKKpK49ZfXxm0mCdbS9sFTNahK5IAesDvAqMQis7wTxRrrqSRG2zGgabYgTNbRWD2OklttTJPtSA4940kisfHOEQwWBZol7MVarJItDqVEeiT80wLa3pr+5gb/8ZtWrBBfCOjAkEJY7AUmOSm5AfYxAXhJzE8QbKWhGZiLCzxD7N7cXUZuwLJ5NrM7Q9X06OxXwYoBDrS35B+3DEkjPBqI1AM/H9AFj62jTj35j4r83p8bWsElBcCiut8Vvdw7QXWiICDyFnNcmYR7C5J/iYUXhh9uDH7pjfeZkbKkV5heNwTIoA2Q3GozRPv966ktNJRBw0zN++P8n9ER7aRV7MgsoevwBQQCeC/KA47lQ34nf6uMmGum2wVIe9b4PCPoAOrYPW8h0eKfhnmkHLJEhaKPhvZISBH+9BQriBln73ASwbDt92FWwOqNF/vOH8UsxCsLzUxPd686st0PSSs****
Tue, 06 Dec 2022 10:47:17 GMT
Share a directory within a bucket and specify where to save the authorization code
Use the following command to share objects in the file folder within the bucketname bucket, and save the authorization code to /tmp/tosutil/authorization_code. The authorization code is valid for two hours.
./tosutil share-crt tos://bucketname/file/ -dst=/tmp/tosutil/authorization_code -vp=2h
The result is generated to [/tmp/tosutil/authorization_code]
Use the following command to share the object1.png object in the bucketname bucket.
./tosutil share-crt tos://bucketname/object1.png -em
https://document-share.tos-cn-beijing.volces.com/index.html?token=/****+aY3yfy+JmQ2Yd144VAZ5FuFbHru0ADVaY5wZkCUQMZYifSKe5n1IL2WqrqLb/bzYMKl2lqdIZPG8dBL4XEXeKE9SqtS4n+f17aaSIBU3B288ly9ANNBJ7eaBCni7/UKKpK49ZfXxm0mCdbS9sFTNahK5IAesDvAqMQis7wTxRrrqSRG2zGgabYgTNbRWD2OklttTJPtSA4940kisfHOEQwWBZol7MVarJItDqVEeiT80wLa3pr+5gb/8ZtWrBBfCOjAkEJY7AUmOSm5DKH9vSYHHsx/NyPU4pOITmYALY8oDS2RmyGLwKV2MGv0dZSMViKFFVYn8M2mjXeadd1uvOFhXRjgj3jn1sJzyca9cgeCgH93dI6Tpa/DvZRdVY1IUhuCEX3ast2dhhsbSdzhmcV4PJ0jfxIvjdEGhYbp8wbfXVwJ028DBsvToRFpSIbr5fvYPAb2y7Wxp0AdXdUKXdWOtE2Ui9o+A8frSKcSAQxvW2EBLKoaL9GWQdrXhaYZtCLqd0TcOqr2d5GjuyJiMzqf9i5Wu98ydLsEYBiN8t1pbKOXuNMDbK/****
Tue, 06 Dec 2022 10:48:12 GMT
Last updated: 2025.12.17 18:33:45